Skip to content

Commit e9d53d2

Browse files
committed
Fix first line ending in paragaph after frontmatter
Closes GH-143.
1 parent 4e92bb3 commit e9d53d2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/to_html.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ fn on_exit_break(context: &mut CompileContext) {
743743

744744
/// Handle [`Exit`][Kind::Exit]:[`BlankLineEnding`][Name::BlankLineEnding].
745745
fn on_exit_blank_line_ending(context: &mut CompileContext) {
746+
context.slurp_one_line_ending = false;
746747
if context.index == context.events.len() - 1 {
747748
context.line_ending_if_needed();
748749
}

tests/frontmatter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ fn frontmatter() -> Result<(), message::Message> {
9191
"should support spaces and tabs after closing fence"
9292
);
9393

94+
assert_eq!(
95+
to_html_with_options("---\n---\na\nb", &frontmatter)?,
96+
"<p>a\nb</p>",
97+
"should support line endings after frontmatter"
98+
);
99+
94100
assert_eq!(
95101
to_html_with_options("--- a\n---", &frontmatter)?,
96102
"<h2>--- a</h2>",

0 commit comments

Comments
 (0)