A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Python-Markdown/markdown/issues/898 below:

attr_list ext strips curly braces from table cells · Issue #898 · Python-Markdown/markdown · GitHub

Curly braces in the elements of a table get stripped away when the 'extra' extension is loaded

#! /usr/bin/env python3
import markdown
from markdown.extensions.extra import ExtraExtension
from markdown.extensions.tables import TableExtension

text = '''
Try {}

A  |  B
---|---
a{}| b{}

'''

extra = ExtraExtension()
tables= TableExtension()

md = markdown.Markdown(extensions=[tables])
print( md.convert(text) ) # this is fine

print("\n\n")

md = markdown.Markdown(extensions=[tables, extra])
print( md.convert(text) ) # curly braces in the table are stripped

The output (comments added manually):

<p>Try {}</p>
<table>
<thead>
<tr>
<th>A</th>
<th>B</th>
</tr>
</thead>
<tbody>
<tr>
<td>a{}</td>  -- braces are there
<td>b{}</td>
</tr>
</tbody>
</table>



<p>Try {}</p>  -- these braces are preserved
<table>
<thead>
<tr>
<th>A</th>
<th>B</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>  -- braces gone
<td>b</td>
</tr>
</tbody>
</table>

Is it an intended behaviour?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4