tiptap-markdown icon indicating copy to clipboard operation
tiptap-markdown copied to clipboard

Greater than/less than characters not properly rendered when content does not contain any markdown syntax

Open schuma7 opened this issue 1 year ago • 0 comments

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 &gt; and &lt;

To Reproduce

  1. In the useEditor hook add the following extensions:
[
  Bold,
  Document,
  Italic,
  Text,
  Paragraph,
  Markdown.configure({
            linkify: true,
            transformCopiedText: true,
            transformPastedText: true,
  })
]
  1. Set the content using editor.commands.setContent('a>b', false, { preserveWhitespace: 'full', });
  2. The editor renders the escaped characters instead of the <, > chars: image

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:

image

schuma7 avatar Nov 28 '24 15:11 schuma7