Skip to content

Cannot correctly escape closing ~ #3516

@mjbvz

Description

@mjbvz

Marked version: 14.1.3

Describe the bug
Cannot use \ to escape ~

To Reproduce
Steps to reproduce the behavior:

*a\* ~b\~

https://marked.js.org/demo/?outputType=html&text=*a%5C*%20~b%5C~&options=%7B%0A%20%22async%22%3A%20false%2C%0A%20%22breaks%22%3A%20false%2C%0A%20%22extensions%22%3A%20null%2C%0A%20%22gfm%22%3A%20true%2C%0A%20%22hooks%22%3A%20null%2C%0A%20%22pedantic%22%3A%20false%2C%0A%20%22silent%22%3A%20false%2C%0A%20%22tokenizer%22%3A%20null%2C%0A%20%22walkTokens%22%3A%20null%0A%7D&version=14.1.3

Expected behavior
This should result in *a* ~b~ being rendered as text instead of markup

Instead we get:

<p>*a* <del>b\</del></p>

Works for the * and also seems to work if the opening ~ is escaped instead of the closing one

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions