You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We want to have line breaks in table rows to format the text.
Othe markdown viewers/editors allow this by using <br> or <br /> tags.
Describe the solution you'd like
Support <br> tags or other formating tags to allow line breaks in table rows like this:
My main concern about HTML would be that we properly need to ensure to purify/sanitize it, though I think tiptap/prosemirror might already take care of that quite well.
markdown-it provides 2 possible strategies to produce safe output:
Don't enable HTML. Extend markup features with plugins. We think it's the best choice and use it by default.
- That's ok for 99% of user needs.
- Output will be safe without sanitizer.
Enable HTML and use external sanitizer package.
I'd like to avoid enabling HTML. But I think we could support <br> without enabling it. It would require us to parse <br> and <br /> inside a table as a token of it's own and turn it into a <br> tag when parsing the markdown. I think tiptap would handle that <br> tag just fine.
We'd also need to serialize <br> tags in tables to that token in the toMarkdown function of table cells or so.
Activity
juliusknorr commentedon Jul 19, 2022
Sounds reasonable to support that, even if that is not something that makes the output markdown table very readable.
Any thoughts @max-nextcloud ?
susnux commentedon Jul 19, 2022
We should support the
<br>syntax as this is the most common one,\is only supported by pandoc (as far as I know).mejo- commentedon Oct 5, 2022
Not sure about the
<br>syntax as that feels like a first step to introduce HTML into our markdown set. What do others think? @vinicius73, @max-nextcloud, @juliushaertl, @juliushaertl, @jancborchardt?juliusknorr commentedon Nov 14, 2022
My main concern about HTML would be that we properly need to ensure to purify/sanitize it, though I think tiptap/prosemirror might already take care of that quite well.
max-nextcloud commentedon Nov 15, 2022
The security recommendations of markdown-it say:
I'd like to avoid enabling HTML. But I think we could support
<br>without enabling it. It would require us to parse<br>and<br />inside a table as a token of it's own and turn it into a<br>tag when parsing the markdown. I think tiptap would handle that<br>tag just fine.We'd also need to serialize
<br>tags in tables to that token in thetoMarkdownfunction of table cells or so.