aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/html_text.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/construct/html_text.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/construct/html_text.rs b/src/construct/html_text.rs
index ffbc768..c3b0a65 100644
--- a/src/construct/html_text.rs
+++ b/src/construct/html_text.rs
@@ -666,11 +666,15 @@ pub fn line_ending_before(tokenizer: &mut Tokenizer) -> State {
/// ^
/// ```
pub fn line_ending_after(tokenizer: &mut Tokenizer) -> State {
- tokenizer.attempt(
- State::Next(StateName::HtmlTextLineEndingAfterPrefix),
- State::Next(StateName::HtmlTextLineEndingAfterPrefix),
- );
- State::Retry(space_or_tab(tokenizer))
+ if matches!(tokenizer.current, Some(b'\t' | b' ')) {
+ tokenizer.attempt(
+ State::Next(StateName::HtmlTextLineEndingAfterPrefix),
+ State::Nok,
+ );
+ State::Retry(space_or_tab(tokenizer))
+ } else {
+ State::Retry(StateName::HtmlTextLineEndingAfterPrefix)
+ }
}
/// After eol, after optional whitespace.