Text(markdown:) drops headings and can generate invalid HTML for block Markdown · Issue #874 · twostraws/Ignite · GitHub
Skip to content

Text(markdown:) drops headings and can generate invalid HTML for block Markdown #874

Description

@esconner

Text(markdown:) currently treats rendered Markdown as either a single paragraph or multiple adjacent paragraphs and then does HTML string surgery on the result.

That breaks for block Markdown that mixes headings, paragraphs, and lists:

  • the first heading is always parsed with removeTitleFromBody: true, so a heading can disappear from the rendered body
  • block content can be rewrapped into invalid paragraph structure
  • after HTML prettification this can show up as empty <p></p> elements that adversely affect layout

Minimal example:

Text(markdown: """
## Heading 1
Text 1

Text 2

## Heading 2
Text 3
""")

Expected:

- both headings are preserved
- paragraphs remain valid
- block Markdown renders as valid block HTML

Actual:

- headings can disappear
- invalid paragraph HTML can be produced
- prettification can normalize the broken structure into empty paragraphs

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions