maddy icon indicating copy to clipboard operation
maddy copied to clipboard

[Bug][Markdown]: Does not detect the two Spaces at the End of the line

Open Voronwe-the-guide opened this issue 9 months ago • 1 comments

Operating System

OSX

Compiler

clang

Compiler flags

-std=gnu++20

maddy version

1.4.0 (latest)

Minimal Mardown example

MarkdownTest.md

What is not working? What did you try?

According to the Markdown Spec, a line should end with two Spaces to make a break (https://www.markdownguide.org/basic-syntax/#line-breaks) However, it seems to ignore the two spaces. I added some quick fix into breaklineparser.h:

line = std::regex_replace(line, re, replacement);
if (line.ends_with(" ")) { line.append(replacement);

This works unfortunately only with C++ 20 Reason for writing it this way is to avoid to replaces 2 Space in the middle of a line by

Voronwe-the-guide avatar Apr 16 '25 09:04 Voronwe-the-guide

To get a br-Tag you can use \r\n - also documented at https://github.com/progsource/maddy/blob/master/docs/definitions.md#break-line

I intend to follow the CommonMark Markdown specs closer with maddy 2.0 which I'm still working on.

progsource avatar Apr 18 '25 02:04 progsource