maddy icon indicating copy to clipboard operation
maddy copied to clipboard

unordered/ordered list are not working correctly in some conditions

Open asnagni opened this issue 1 year ago • 0 comments

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"(

Prioritization of Actions

The feedback data was collected on a numerical scale from 1 to 5, where higher scores indicate higher satisfaction. Here is a summary of the satisfaction levels:

  • Average Score: 3.5
  • Score Distribution:
    • Score 5: 34%
    • Score 4: 14%
    • Score 3: 20%
    • Score 2: 18%
    • Score 1: 14%

)";

        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?

I noticed that the unordered list parser define in “unorderedlistparser.h” as an issue:

  1. case 1: If you don’t have a space between the unordered list and the previous text, the parser will fail to process properly the unordered list.

  2. case 2: if you do have a space between the previous text the unordered list, the parser will parse properly (100% correct).

These are examples to illustrate what I got:

case 1: No space between the unordered list and the previous text.

The markdown input: The feedback data was collected on a numerical scale from 1 to 5, where higher scores indicate higher satisfaction. Here is a summary of the satisfaction levels:

  • Average Score: 3.5
  • Score Distribution:
    • Score 5: 34%
    • Score 4: 14%
    • Score 3: 20%
    • Score 2: 18%
    • Score 1: 14%

The Html output: The feedback data was collected on a numerical scale from 1 to 5, where higher scores indicate higher satisfaction. Here is a summary of the satisfaction levels: - Average Score: 3.5 - Score Distribution: - Score 5: 34% - Score 4: 14% - Score 3: 20% - Score 2: 18% - Score 1: 14%

case 2: We do a space have between the unordered list and the previous text.

The markdown input: The feedback data was collected on a numerical scale from 1 to 5, where higher scores indicate higher satisfaction. Here is a summary of the satisfaction levels:

  • Average Score: 3.5
  • Score Distribution:
    • Score 5: 34%
    • Score 4: 14%
    • Score 3: 20%
    • Score 2: 18%
    • Score 1: 14%

The Html output:

The feedback data was collected on a numerical scale from 1 to 5, where higher scores indicate higher satisfaction. Here is a summary of the satisfaction levels:
	•	Average Score: 3.5
	•	Score Distribution:
	    ◦	Score 5: 34%
	    ◦	Score 4: 14%
	    ◦	Score 3: 20%
	    ◦	Score 2: 18%
	    ◦	Score 1: 14%

asnagni avatar Jul 10 '24 16:07 asnagni