You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently discovered https://github.com/notlmn/copy-as-markdown, which copies the selected HTML as Markdown. It fails to properly escape angle brackets. For example, in the current README.md for this repo, this text appears: <h1>1. Hello world</h1>. I would expect it to be converted to \<h1\>1. Hello world\</h1\> when I copy this plain text to Markdown. However, it instead appears without backslashes escaping the angle brackets.
In the code, I notice that in the escapes array, there is no entry at all for the open angle bracket <, and it appears that the close angle bracket '>' may only be escaped at the beginning of the string, although I haven't read the code enough to know for sure.
The text was updated successfully, but these errors were encountered:
Not sure I understand the issue. HTML blocks are not escaped. Also the <h1>1. Hello world</h1> in is not escaped in the source as well (mainly because it is part of code block there, but that makes your example kind of invalid).
Please always provide a sample input and output that reproduces the issue.
If I understand it correctly, the issue is that e.g. turndownService.turndown('...<h1>...') becomes ...<h1>..., is that correct?
Btw. this issue will be addressed by the advanced escaping subsystem that is planned. It will be adopted from gfm-escape, which addresses also this. But I guess we should address it already in the current escape subsystem as well.
I recently discovered https://github.com/notlmn/copy-as-markdown, which copies the selected HTML as Markdown. It fails to properly escape angle brackets. For example, in the current README.md for this repo, this text appears:
<h1>1. Hello world</h1>
. I would expect it to be converted to\<h1\>1. Hello world\</h1\>
when I copy this plain text to Markdown. However, it instead appears without backslashes escaping the angle brackets.In the code, I notice that in the
escapes
array, there is no entry at all for the open angle bracket<
, and it appears that the close angle bracket '>' may only be escaped at the beginning of the string, although I haven't read the code enough to know for sure.The text was updated successfully, but these errors were encountered: