2020-01-09 08:12:21 -05:00
|
|
|
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
|
|
|
|
2019-12-25 21:47:18 -05: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();
|
|
|
|
};
|
2019-12-23 06:48:41 -05:00
|
|
|
Ok(())
|
|
|
|
}
|