From 7350acc692a79d9d4cf56afbc53ac3c9f2a6237c Mon Sep 17 00:00:00 2001
From: Titus Wormer
Date: Thu, 16 Jun 2022 12:55:50 +0200
Subject: Add support for hard break (trailing)
---
src/compiler.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'src/compiler.rs')
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("
".to_string());
}
- TokenType::HardBreakEscape => {
+ TokenType::HardBreakEscape | TokenType::HardBreakTrailing => {
buf_tail_mut(buffers).push("
".to_string());
}
TokenType::CodeIndented | TokenType::CodeFenced => {
--
cgit