Fix MarkdownParser paragraph interpretation

Fixed a bug that added multiple paragraph HTML tags on non-paragraph new
lines.
This commit is contained in:
luca0N! 2022-03-02 18:08:37 -03:00
parent 9f94172050
commit 4c47a02f61
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
1 changed files with 2 additions and 1 deletions

View File

@ -57,6 +57,7 @@ std::string make_html(std::filesystem::path const &path) {
if (tag_p && buf[0] == '\n') { if (tag_p && buf[0] == '\n') {
// Empty newline; end paragraph. // Empty newline; end paragraph.
html += "</p>\n"; html += "</p>\n";
tag_p = false;
continue; continue;
} }
@ -83,7 +84,7 @@ std::string make_html(std::filesystem::path const &path) {
// Start paragraph if newline and no // Start paragraph if newline and no
// special characters were matched. // special characters were matched.
if (newline && x == 0 && c != '#') if (!tag_p && newline && x == 0 && c != '#')
html += "<p>", html += "<p>",
tag_p = true; tag_p = true;