Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Velin92 committed Dec 14, 2023
1 parent f111392 commit cab37f7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ impl MarkdownHTMLParser {
let markdown = markdown.to_string();
let parser_events: Vec<_> = Parser::new_ext(&markdown, options)
.map(|event| match event {
// this allows for line breaks to be parsed correctly from markdown
Event::SoftBreak => Event::HardBreak,
_ => event,
})
Expand All @@ -45,6 +46,7 @@ impl MarkdownHTMLParser {
// correct way to handle a text block in Markdown. But it breaks our
// assumption regarding the HTML markup. So let's remove it.
let html = {
// only remove the external <p> if there is only one
if html.starts_with("<p>") && html.matches("<p>").count() == 1 {
let p = "<p>".len();
let ppnl = "</p>\n".len();
Expand Down

0 comments on commit cab37f7

Please sign in to comment.