mondeja / mkdocs-include-markdown-plugin

Mkdocs Markdown includer plugin
Apache License 2.0
111 stars 20 forks source link

Include a table as part of a list item #192

Closed panicseal closed 10 months ago

panicseal commented 10 months ago

Hello, thank you for this great mkdocs plugin!

I'm trying to include a table in different contexts, and one of them is a list. This breaks the table rendering.

file tbl.md

| A   | B   |
|-----|-----|
| foo | bar | 

file main.md

### Table included as part of a list item:
1. A list entry
1. Item with table

    {%
      include-markdown "./tbl.md"
    %}

1. Another list entry

### Expected output:
1. A list entry
1. Item with table

    | A   | B   |
    |-----|-----|
    | foo | bar |

1. Another list entry

See attached screenshot with rendered result: firefox_2024-01-29_14-29-16

I hope this can be fixed / implemented. Thank you very much for your time and effort to provide this plugin!

mondeja commented 10 months ago

Just use comments=false:

{%
    include-markdown "./tbl.md"
    comments=false
%}

Comments are breaking the parsing of the list item. You can disable them globally in Global configuration.

panicseal commented 10 months ago

Thank you very much for the swift reply and solution. I wish you all the best.