Skip to content

Allow line breaks in table rows #2725

Closed

Description

@theroch

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:

| **Org** | **Name** | **Contact** |
|-----|------|--------------|
| Org | Name | E-Mail: my@mail.com <br> Tel: 01/ 123456789 |

Describe alternatives you've considered
We already tested with double spaces, \, \n,
nothing works.

Additional context
See also https://stackedit.io/app#

Activity

  1. added
    enhancement
    on Jul 16, 2022
  2. juliusknorr commented on Jul 19, 2022

    @juliusknorr
    Member

    Sounds reasonable to support that, even if that is not something that makes the output markdown table very readable.

    Any thoughts @max-nextcloud ?

  3. susnux commented on Jul 19, 2022

    @susnux
    Contributor

    We should support the <br> syntax as this is the most common one, \ is only supported by pandoc (as far as I know).

  4. mejo- commented on Oct 5, 2022

    @mejo-
    Member

    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?

  5. juliusknorr commented on Nov 14, 2022

    @juliusknorr
    Member

    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.

  6. max-nextcloud commented on Nov 15, 2022

    @max-nextcloud
    Contributor

    The security recommendations of markdown-it say:

    markdown-it provides 2 possible strategies to produce safe output:

    1. 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.
    2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementformat: markdown

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions