Skip to content

Markdown serialization does not preserve escaped blocks after round-trip #8134

Description

@olfusitus

Affected Packages

markdown

Tiptap Version

3.29.1

Browser Used

Not browser-specific

What happened?

Description

Escaped block syntax is parsed correctly as paragraph text, but loses the required escape on serialization.

Reproduction

In the full Markdown demo, enter:

\# not a heading

1\. not a list
  1. Click Parse Markdown
    -> Both lines correctly appear as paragraph text.
  2. Click Extract Markdown
    -> Extracted Markdown is
# not a heading

1. not a list
  1. Click Parse Markdown again
    -> The first line becomes a heading and the second line becomes a list item.

The same round-trip issue also affects other escaped blocks, including \-, \+, \---, Setext Headings and GFM table pipes.

Expected Behavior

The parse, serialize, parse round-trip should preserve the document structure.

Reproducible Example URL (Optional)

No response

Additional Context (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: markdownMarkdown parsing and serializationstatus: triageNeeds initial review and categorization

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions