tiptap-markdown
tiptap-markdown copied to clipboard
Greater than/less than characters not properly rendered when content does not contain any markdown syntax
Describe the bug
When setting a simple content string containing the < or > chars but not containg any other Markdown-specific syntax, such as "a > b" for example, the editor renders the escaped versions > and <
To Reproduce
- In the
useEditorhook add the following extensions:
[
Bold,
Document,
Italic,
Text,
Paragraph,
Markdown.configure({
linkify: true,
transformCopiedText: true,
transformPastedText: true,
})
]
- Set the content using
editor.commands.setContent('a>b', false, { preserveWhitespace: 'full', }); - The editor renders the escaped characters instead of the <, > chars:
Expected behavior I'd expect the <, > chars to be rendered instead of their escaped versions.
Desktop (please complete the following information):
- OS: Mac OS Sequioa 15.1.1
- Browser: Chrome
- Version: 131.0.6778.71 (Official Build) (arm64)
Additional context
Interestingly, adding any Markdown-syntax to the content will cause the content to be rendered as expected
editor.commands.setContent('*italic* a>b', false, { preserveWhitespace: 'full', });
will render: