-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
When rendering a markdown, marko break the indentation of tables who are list item children:
>>> from marko import Markdown
>>> from marko.md_renderer import MarkdownRenderer
>>> text = "- List item.\n\n |foo|bar|\n |---|---|\n |foo|bar|"
>>> print(text)
- List item.
|foo|bar|
|---|---|
|foo|bar|
>>> md = Markdown(extensions=["gfm"], renderer=MarkdownRenderer)
>>> print(md.convert(text))
- List item.
| foo | bar |
| --- | --- |
| foo | bar |Marko result is rendered like this on GitHub:
- List item.
| foo | bar |
|---|---|
| foo | bar |
The original text is rendered like this:
- List item.
foo bar foo bar
The default html renderer keep the table a child of the list item:
>>> from marko import Markdown
>>> md = Markdown(extensions=["gfm"])
>>> print(md.convert("- List item.\n\n |foo|bar|\n |---|---|\n |foo|bar|"))
<ul>
<li>
<p>List item.</p>
<table>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<tr>
<td>foo</td>
<td>bar</td>
</tr>
</tbody></table></li>
</ul>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels