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

Removal of HTML-like code is too aggressive, removes valid uses of angle brackets as text

Open gnapse opened this issue 2 years ago • 0 comments

Here are 3 examples that I think can be valid markdown text, that remove-markdown alters in ways that I think are unexpected. For each of them I listed the string provided as input to removeMarkdown, the output it gives, that I believe is not expected, the output I'd expect, and then I also am letting GitHub's very markdown processing in this comment to render them, to show how it does not remove the parts that removeMarkdown is removing entirely:

  1. Two separate uses of angle brackets that happen to occur in the same order as in html tags:

    • Input: The equations 2 < 3 and 3 > 1 are both true
    • Actual (incorrect?) output: The equations 2 1 are both true
    • Expected output: The equations 2 < 3 and 3 > 1 are both true
    • GitHub's output: The equations 2 < 3 and 3 > 1 are both true
  2. Angle brackets inside code elements:

    • Input: HTML tags look like this: `<div>`.
    • Actual (incorrect?) output: HTML tags look like this: .
    • Expected output: HTML tags look like this: <div>.
    • GitHub's output: HTML tags look like this: <div>.
  3. Angle brackets used in the text intentionally as a grouping pair:

    • Input: You can write to John Doe <john.doe AT example DOT com>
    • Actual (incorrect?) output: You can write to John Doe
    • Expected output: You can write to John Doe <john.doe AT example DOT com>
    • GitHub's output: You can write to John Doe <john.doe AT example DOT com>

I realize that some of these may not be easy to fix. But I wonder what could be done about it?

gnapse avatar Jun 08 '22 21:06 gnapse