copycat icon indicating copy to clipboard operation
copycat copied to clipboard

tables with multiline text

Open AntonioGHub opened this issue 4 years ago • 0 comments

It is rather common and annoying to find, on the internet, table cells which have new lines in.

The new lines are rendered as they are, i.e. as new lines, which clashes with the new line character used in markdown to separate rows. As a result, html tables which contain <br> or <p> elements break the rendered markdown.

For instance an html table structured like this:

|  heading 1   |   heading 2   |
|--------------|---------------|
| a line       | just one line |
| another line |               |
|--------------|---------------|
| and so       |               |
| on           |               |
|--------------|---------------|
|              |               |

might be rendered preserving the <br> and <p> tags

|       heading 1        |   heading 2   |
|------------------------|---------------|
| a line<br>another line | just one line |
| and so<p>on</p>        |               |

And, if it may make sense, and could be easy to implement, it could be useful to implement some dialect that supports multiline-row and recursively render the cell content as a new markdown text. So for instance complex formatting might be preserved within a cell (for instance bulleted lists, italics and so on):

|   heading 1    |   heading 2   |
|----------------|---------------|
| * a line       | just one line |
| * another line |               |
|----------------|---------------|
| and so         |               |
| _on_           |               |
|----------------|---------------|

(see azure devops - How can I add a table with multi-row cells to a readme in VSTS? - Stack Overflow for info about multi-line tables).

AntonioGHub avatar Sep 11 '19 07:09 AntonioGHub