lepture/mistune

Newlines in table cells

lucafaggianelli opened this issue · 1 comments

I'm having a hard time creating newlines in table cells, I tried using both \n and <br/> with no luck. Is this somehow supported?

@lucafaggianelli you can't use \n, but <br/> with escape=False should work.

Here is my test script:

import mistune

s = '''
Header | Header
------ | -------
a<br/>b | foo
'''

plugins = ['table']
md = mistune.create_markdown(plugins=plugins, escape=False)

rv = md(s)
print(rv)

The output is:

<table>
<thead>
<tr>
  <th>Header</th>
  <th>Header</th>
</tr>
</thead>
<tbody>
<tr>
  <td>a<br/>b</td>
  <td>foo</td>
</tr>
</tbody>
</table>