diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-26 16:37:13 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-26 16:37:13 +0200 |
commit | a6b317ac7fbc95b8584056b3cebffbf9d1bba2c6 (patch) | |
tree | fd7be2fe6d7355d3aafaf8b731f0e0b48624debc /src/token.rs | |
parent | 297784cb925b1196d89479fa24c898703ae598d6 (diff) | |
download | markdown-rs-a6b317ac7fbc95b8584056b3cebffbf9d1bba2c6.tar.gz markdown-rs-a6b317ac7fbc95b8584056b3cebffbf9d1bba2c6.tar.bz2 markdown-rs-a6b317ac7fbc95b8584056b3cebffbf9d1bba2c6.zip |
Refactor to drastically improve perf around whitespace
Diffstat (limited to 'src/token.rs')
-rw-r--r-- | src/token.rs | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/src/token.rs b/src/token.rs index fd7999d..a0479e1 100644 --- a/src/token.rs +++ b/src/token.rs @@ -872,25 +872,6 @@ pub enum Token { /// * **Context**: /// [text content][crate::content::text] /// * **Content model**: - /// [`HardBreakEscapeMarker`][Token::HardBreakEscapeMarker] - /// * **Construct**: - /// [`hard_break_escape`][crate::construct::hard_break_escape] - /// - /// ## Example - /// - /// ```markdown - /// > | a\␊ - /// ^^ - /// > | b - /// ``` - HardBreakEscape, - /// Hard break (escape) marker. - /// - /// ## Info - /// - /// * **Context**: - /// [text content][crate::content::text] - /// * **Content model**: /// void /// * **Construct**: /// [`hard_break_escape`][crate::construct::hard_break_escape] @@ -902,7 +883,7 @@ pub enum Token { /// ^ /// > | b /// ``` - HardBreakEscapeMarker, + HardBreakEscape, /// Whole hard break (trailing). /// /// ## Info @@ -910,28 +891,9 @@ pub enum Token { /// * **Context**: /// [text content][crate::content::text] /// * **Content model**: - /// [`HardBreakTrailingSpace`][Token::HardBreakTrailingSpace] - /// * **Construct**: - /// [`hard_break_trailing`][crate::construct::hard_break_trailing] - /// - /// ## Example - /// - /// ```markdown - /// > | a␠␠␊ - /// ^^^ - /// > | b - /// ``` - HardBreakTrailing, - /// Hard break (trailing) spaces. - /// - /// ## Info - /// - /// * **Context**: - /// [`HardBreakTrailing`][Token::HardBreakTrailing] - /// * **Content model**: /// void /// * **Construct**: - /// [`hard_break_trailing`][crate::construct::hard_break_trailing] + /// [`whitespace`][crate::construct::partial_whitespace] /// /// ## Example /// @@ -940,7 +902,7 @@ pub enum Token { /// ^^ /// > | b /// ``` - HardBreakTrailingSpace, + HardBreakTrailing, /// Whole heading (atx). /// /// ## Info @@ -1884,8 +1846,8 @@ pub const VOID_TOKENS: [Token; 39] = [ Token::DefinitionMarker, Token::DefinitionTitleMarker, Token::EmphasisSequence, - Token::HardBreakEscapeMarker, - Token::HardBreakTrailingSpace, + Token::HardBreakEscape, + Token::HardBreakTrailing, Token::HeadingAtxSequence, Token::HeadingSetextUnderline, Token::HtmlFlowData, |