Skip to content

Newlines within HTML blocks get rendered as <br/> #1941

@zombrodo

Description

@zombrodo

I've been toying with HTML for some custom tables, and I ran into an issue where it appears newlines and whitespace within HTML tags are rendered as <br/> and "&nbsp " before the block instead of being ignored.

Example:

<table>
  <tr>
    <td>foo</td>
    <td>bar</td>
  </tr>
  <tr>
    <td>baz</td>
    <td>boo</td>
  </tr>
</table>

Output:

Image

If I write my HTML as a single line - <table><tr><td>foo</td><td>bar</td></tr></table> then it'll output without the leading whitespace. Here's both side by side:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions