Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.71k stars 856 forks source link

No table support? #1455

Closed buhtz closed 5 months ago

buhtz commented 5 months ago

Is my diagnosis correct that your package do not support markdown tables?

`>>> markdown.markdown('| table |\n| me |')
'<p>| table |\n| me |</p>'`
facelessuser commented 5 months ago

You need to use the table extension: https://python-markdown.github.io/extensions/tables/#usage

buhtz commented 5 months ago

Ah thanks. Why is this an extension? Technically what is it? Another module (py-file) imported? Why is it separated.

Is there an in-between format while converting? I don't need HTML but the structure.

facelessuser commented 5 months ago

Python Markdown is an old-school Markdown parser (not CommonMark) based on the original spec. Tables were not included in the original spec, probably because they are clunky, even with such an extension (that is my speculation). It was provided as an extension though. It has become pretty ubiquitous in modern Markdown implementations, but originally, it was an extension and remains so in this library.

buhtz commented 5 months ago

Do you see away to get the "in-between format" of a table after parsing it? I need to separate the parsing and the conversion into HTML.

facelessuser commented 5 months ago

What "in-between format" are you talking about? What format do you think you are trying to get? I'm not sure what you are doing specifically, but I suspect it extends past the scope of what Python Markdown intends to offer.

buhtz commented 5 months ago

What "in-between format" are you talking about? What format do you think you are trying to get?

For example a two-dimensional array with all cells.

Thanks in advance

facelessuser commented 5 months ago

It doesn't have that. If you want that, you'd have to fork the table extension as is and modify it to do what you want it to do. Python Markdown's goal is to convert that syntax to HTML, and that is what it does.

buhtz commented 5 months ago

you'd have to fork the table extension as is and modify it to do what you want it to do.

I will consider this. Of course will all respect to your work and your license.