Table fills every empty cell with a slash

#15 · closed · 2 comments

View on GitHub ↗

RifRaf44

When converting a table to commonmark, every empty cell has a slash inside of it. ``` <table> <tr> <td><br/></td> </tr> </table> ``` results in ``` <table> <tr> <td>/</td> </tr> </table> ```

Comments

nicojs

This is valid according to the commonmark spec. See the section about [hard line breaks] http://spec.commonmark.org/0.24/#hard-line-breaks). What would you suggest? An option to ignore `<br>` tags without siblings seems a bit too custom for me.

nicojs

I can now see the issue is a bigger one. From the spec: > A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a hard line break (rendered in HTML as a <br /> tag): > ... > For a more visible alternative, a backslash before the line ending may be used instead of two spaces: This means that my 'dumb' conversion (`<br>` always to a `\`) is the problem. I will fix this issue.