From 58ba69452a25c3d4b2059c01cc6cd837159d2f90 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 16 Jun 2022 11:34:35 +0200 Subject: Add support for hard break escape --- src/tokenizer.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/tokenizer.rs') diff --git a/src/tokenizer.rs b/src/tokenizer.rs index c5df42b..a63d209 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -60,6 +60,9 @@ pub enum TokenType { Data, + HardBreakEscape, + HardBreakEscapeMarker, + HtmlFlow, HtmlFlowData, @@ -441,6 +444,7 @@ impl Tokenizer { None, None, None, + None, done, ) } @@ -459,18 +463,20 @@ impl Tokenizer { Some(Box::new(c)), None, None, + None, done, ) } - #[allow(clippy::many_single_char_names)] - pub fn attempt_5( + #[allow(clippy::too_many_arguments, clippy::many_single_char_names)] + pub fn attempt_6( &mut self, a: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, b: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, c: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, d: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, e: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, + f: impl FnOnce(&mut Tokenizer, Code) -> StateFnResult + 'static, done: impl FnOnce(bool) -> Box + 'static, ) -> Box { self.call_multiple( @@ -480,6 +486,7 @@ impl Tokenizer { Some(Box::new(c)), Some(Box::new(d)), Some(Box::new(e)), + Some(Box::new(f)), done, ) } @@ -493,6 +500,7 @@ impl Tokenizer { c: Option>, d: Option>, e: Option>, + f: Option>, done: impl FnOnce(bool) -> Box + 'static, ) -> Box { if let Some(head) = a { @@ -501,7 +509,7 @@ impl Tokenizer { done(ok) } else { Box::new(move |tokenizer: &mut Tokenizer, code| { - tokenizer.call_multiple(check, b, c, d, e, None, done)(tokenizer, code) + tokenizer.call_multiple(check, b, c, d, e, f, None, done)(tokenizer, code) }) } }; -- cgit