Try to skip scanning for html whenever possible
@@ -358,6 +358,7 @@ impl<'a> FirstPass<'a> {
// spaces present before the HTML block begins should be preserved.
let nonspace_ix = start_ix + line_start.bytes_scanned();
+ if self.text.as_bytes()[nonspace_ix] == b'<' {
// Types 1-5 are all detected by one function and all end with the same
// pattern
if let Some(html_end_tag_ix) = get_html_end_tag(&self.text[nonspace_ix..]) {
@@ -374,6 +375,7 @@ impl<'a> FirstPass<'a> {
if let Some(_html_bytes) = scan_html_type_7(&self.text[nonspace_ix..]) {
return self.parse_html_block_type_6_or_7(ix, remaining_space);
}
+ }
// Advance `ix` after HTML blocks have been scanned
let ix = start_ix + line_start.bytes_scanned();
