progsource / maddy

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

Maddy doesn't properly translate tables #58

Open asnagni opened 3 months ago

asnagni commented 3 months 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"(

## Prioritization of Actions

To ensure that the most impactful and feasible actions are taken first, we have prioritized the suggestions as follows:

| Action                               | Impact  | Feasibility | Priority |
|--------------------------------------|---------|-------------|----------|
| Develop Interactive Setup Wizard     | High    | High        | High     |
| Enhance Support Resources            | High    | High        | High     |
| Simplify Instructions                | High    | High        | High     |
| Pilot AR Assistance                  | Medium  | Medium      | Medium   |
| Launch Community Forum               | Medium  | High        | Medium   |

## Engagement Call

We are committed to enhancing your experience and making our product setup as seamless as possible. Your feedback is invaluable in helping us achieve this goal. Stay tuned for upcoming improvements and new features designed to make your experience even better.

)";

            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 table structure is not preserve. The table is treated as a paragraph: The tabs/space /end of line are not processed properly.

This is the Html output:

To ensure that the most impactful and feasible actions are taken first, we have prioritized the suggestions as follows:

| Action | Impact | Feasibility | Priority | |--------------------------------------|---------|-------------|----------| | Develop Interactive Setup Wizard | High | High | High | | Enhance Support Resources | High | High | High | | Simplify Instructions | High | High | High | | Pilot AR Assistance | Medium | Medium | Medium | | Launch Community Forum | Medium | High | Medium |

Engagement Call

We are committed to enhancing your experience and making our product setup as seamless as possible. Your feedback is invaluable in helping us achieve this goal. Stay tuned for upcoming improvements and new features designed to make your experience even better.

Please see screenshot:

IMG_1952431EEBFB-1

progsource commented 2 months ago

Currently only the table markdown listed in the documentation is working: https://github.com/progsource/maddy/blob/master/docs/definitions.md#tables This markdown is planned for the next major version. See also #51

asnagni commented 2 months ago

Ok got it 👍. By the way the table implementation you have is working fine 😊. Good job