minify-html/src/unit/style.rs

20 lines
529 B
Rust
Raw Normal View History

use crate::err::ProcessingResult;
2020-01-25 02:04:02 -05:00
use crate::proc::MatchAction::*;
use crate::proc::MatchMode::*;
2020-01-25 02:07:52 -05:00
use crate::proc::Processor;
2020-07-03 06:37:52 -04:00
pub fn process_style(proc: &mut Processor) -> ProcessingResult<()> {
2020-07-11 08:52:27 -04:00
loop {
proc.require_not_at_end()?;
// Use fast memchr.
proc.m(WhileNotChar(b'<'), Keep);
// `process_tag` will require closing tag.
if proc.m(IsSeq(b"</style"), MatchOnly).nonempty() {
break;
};
// Consume '<'.
proc.accept_expect();
};
Ok(())
}