progsource / maddy

C++ Markdown to HTML header-only parser library
MIT License
194 stars 39 forks source link

Maddy doesn't process properly a list in certain conditions #57

Open asnagni opened 2 weeks ago

asnagni commented 2 weeks ago

Operating System

iOS (C++)

Compiler

clang

Compiler flags

-fno-char8_t , -fmodules, -fcxx-modules, '-std=c++20'

maddy version

1.3.0 (latest)

Minimal C++ example

std::string feedbackReport = R"(##

### Average Score
The average score is also calculated to understand the general sentiment of the users.

**Average Score:** 5.01

### Distribution of Scores
The distribution of CES scores is as follows:
- Score 1: 12
- Score 2: 8
- Score 3: 10
- Score 4: 13
- Score 5: 14
- Score 6: 20
- Score 7: 26

)";

            std::shared_ptr<maddy::ParserConfig> config = std::make_shared<maddy::ParserConfig>();
            config->enabledParsers |= maddy::types::LATEX_BLOCK_PARSER;

            std::shared_ptr<maddy::Parser> parser = std::make_shared<maddy::Parser>(config);
            std::stringstream markdownInput(feedbackReport);
            std::string htmlOutput = parser->Parse(markdownInput);

What is not working? What did you try?

The list is not properly translated in Html if you don't have an empty line between a paragraph/text and the first element of the list. If I don't have "The distribution of CES scores is as follows:" and "- Score 1: 12"

This is the result that I have (it should be a list): IMG_CE909125047F-1

progsource commented 2 weeks ago

I will add it to the tests for the next version to make this work.

asnagni commented 2 weeks ago

Thank you 👍