Skip to content

Markdown: silently dropping ~~~ code fences #7528

@Aratramba

Description

@Aratramba

Affected Packages

@tiptap/markdown

Version(s)

3.19.0

Bug Description

The @tiptap/markdown extension silently drops code blocks that use tilde fences (~~~), which are valid CommonMark and GFM syntax. Backtick fences (```) are parsed correctly.

This renders nothing at all:

~~~
code block
~~~

Tildes are already valid input:

export const tildeInputRegex = /^~~~([a-z]+)?[\s\n]$/

Looks like we need to update it here:

if (token.raw?.startsWith('```') === false && token.codeBlockStyle !== 'indented') {

Browser Used

Chrome

Code Example URL

https://codesandbox.io/p/sandbox/tender-sara-9m5jr2

Expected Behavior

I expect tilde fenced code blocks to render the same as backtick fenced code blocks.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

Labels

Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions