Neoteroi / mkdocs-plugins

Plugins for MkDocs.
MIT License
116 stars 9 forks source link

Spantable: does not work with mkdocs-material admonitions #30

Open HuangFuSL opened 1 year ago

HuangFuSL commented 1 year ago

Hi. I'm using mkdocs-plugins and mkdocs-material to build my personal blog. Thanks for your work, these plugins really help a lot.

However, once when I was trying to put a table into an admonition tab provided by mkdocs-material, I found that spantable fails to be rendered inside the tab while a normal markdown table works as expected. Here is a minimal test markdown file to reproduce these results.

environment

A full environment configuration can be found here.

mkdocs configuration

This is a simplified configuration, only part of configuration fields are listed below. A full mkdocs configuration can be found here.

theme:
  name: material

markdown_extensions:
  - admonition
  - neoteroi.spantable

extra_css:
  - https://www.neoteroi.dev/mkdocs-plugins/css/neoteroi.css

test file

Documentation of mkdocs-material admonitions can be found here.

# Spantable test

??? note "This is a spantable"

    ::spantable::

    | Country      | Address                                                  |
    | ------------ | -------------------------------------------------------- |
    | France @span | 8 Rue St Ferréol - 92190 City: Meudon (Île-de-France)    |
    |              | 50 boulevard Amiral Courbet - 94310 Orly (Île-de-France) |
    |              | ...                                                      |
    |              | ...                                                      |
    | Italy @span  | Str. S. Maurizio, 12, 10072 Caselle torinese TO          |
    |              | S.S. Torino-Asti - 10026 Santena (TO)                    |
    |              | ...                                                      |
    | Poland @span | al. Jana Pawła II 22, 00-133 Warszawa                    |
    |              | plac Trzech Krzyży 4/6, 00-535 Warszawa                  |
    |              | ...                                                      |
    |              | ...                                                      |

    ::end-spantable::

??? note "This is a normal markdown table"

    | Country      | Address                                                  |
    | ------------ | -------------------------------------------------------- |
    | France       | 8 Rue St Ferréol - 92190 City: Meudon (Île-de-France)    |
    | Italy        | Str. S. Maurizio, 12, 10072 Caselle torinese TO          |
    | Poland       | al. Jana Pawła II 22, 00-133 Warszawa                    |

test result

Spantable:

image

Markdown table:

image

PlasmaHH commented 3 weeks ago

Just came here to repor the same thing. Similarily it does not work for tabs and other things that need indentation.

My guess here is that this plugin does not pick up the amount of indentation present in the definition and gives back the generated code with zero indentation but the tabs, admonitions etc. expect it to still be indented to be picked up.

At least doing it that way with the standard markdown syntax leads to the same broken appearance.