diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-06-16 12:55:50 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-06-16 12:55:50 +0200 |
commit | 7350acc692a79d9d4cf56afbc53ac3c9f2a6237c (patch) | |
tree | 02f8b83230a40b509adf4b4872e313544c7fc80f /src/compiler.rs | |
parent | 58ba69452a25c3d4b2059c01cc6cd837159d2f90 (diff) | |
download | markdown-rs-7350acc692a79d9d4cf56afbc53ac3c9f2a6237c.tar.gz markdown-rs-7350acc692a79d9d4cf56afbc53ac3c9f2a6237c.tar.bz2 markdown-rs-7350acc692a79d9d4cf56afbc53ac3c9f2a6237c.zip |
Add support for hard break (trailing)
Diffstat (limited to 'src/compiler.rs')
-rw-r--r-- | src/compiler.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index 3aacca0..9f84a38 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -152,6 +152,8 @@ pub fn compile(events: &[Event], codes: &[Code], options: &CompileOptions) -> St | TokenType::Whitespace | TokenType::HardBreakEscape | TokenType::HardBreakEscapeMarker + | TokenType::HardBreakTrailing + | TokenType::HardBreakTrailingSpace | TokenType::HtmlFlowData | TokenType::HtmlTextData | TokenType::CodeFencedFence @@ -195,6 +197,7 @@ pub fn compile(events: &[Event], codes: &[Code], options: &CompileOptions) -> St | TokenType::CharacterReference | TokenType::CharacterReferenceMarkerSemi | TokenType::HardBreakEscapeMarker + | TokenType::HardBreakTrailingSpace | TokenType::Autolink | TokenType::AutolinkMarker => {} TokenType::HtmlFlow | TokenType::HtmlText => { @@ -211,7 +214,7 @@ pub fn compile(events: &[Event], codes: &[Code], options: &CompileOptions) -> St TokenType::Paragraph => { buf_tail_mut(buffers).push("</p>".to_string()); } - TokenType::HardBreakEscape => { + TokenType::HardBreakEscape | TokenType::HardBreakTrailing => { buf_tail_mut(buffers).push("<br />".to_string()); } TokenType::CodeIndented | TokenType::CodeFenced => { |