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

Remove unnecessary escapes

Open Rafatcb opened this issue 1 year ago • 0 comments

I used the ESLint rule no-useless-escape to highlight unnecessary escapes in the Regex. You can also see this Stack Overflow answer for more details on characters that need to be escaped and those that do not need to be escaped when inside character classes.

I also noticed that the should still remove escaped markdown syntax test is not working correctly, because the string \# Heading in _italic_ is interpreted as # Heading in _italic_, and if you add double backslashes in the beginning (\\# Heading in _italic_) the test fails. You can see more details about using backslashes in strings here.

If you want me to add ESLint as a development dependency to the project, with the no-useless-escape rule as the only active rule, let me know.

Rafatcb avatar Jan 31 '24 22:01 Rafatcb