react-textarea-code-editor icon indicating copy to clipboard operation
react-textarea-code-editor copied to clipboard

Markdown html code blocks break

Open PrettyCoffee opened this issue 11 months ago • 0 comments

Hey :)

When using markdown as language and typing something like this:

\```html
<div />
\```

(without the backslash)

The < character will be replaced by &lt;.

E.g. in the demo: image

My guess was that this bit of code is at fault: https://github.com/uiwjs/react-textarea-code-editor/blob/f8280760e58ec7a1af16f81880499d5a5762e5f1/core/src/utils.ts#L14C1-L19C7

But unfortunately, I can't figure out why it needs to be escaped twice and didn't feel comfortable with raising a PR about it, in fear of breaking something else. 😅

PrettyCoffee avatar Nov 17 '24 16:11 PrettyCoffee