Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding \ before <tag> should render it as "<tag>" and not parse as html #374

Closed
ghost opened this issue Apr 9, 2017 · 5 comments
Closed
Assignees

Comments

@ghost
Copy link

ghost commented Apr 9, 2017

source code
source code

how it should be
how it should be

how it is now
how it is now on blocks

/rel marked#884

@ghost ghost changed the title adding \ before <tag> should render it as <tag> and not parse as html adding \ before <tag> should render it as "<tag>" and not parse as html Apr 9, 2017
@tivie tivie self-assigned this Apr 11, 2017
@tivie
Copy link
Member

tivie commented Apr 11, 2017

That's actually a non standard implementation. But since GFM (github) also uses it, we will implement it as a feature.

@ghost
Copy link
Author

ghost commented Apr 11, 2017

what should be happening here is \ before any control-symbol turns it to a simple char, making < to an &#60;, and since tag> is not a valid html – parser should leave it as text like it is with other things, like \# H1

test:

regular H1

# escaped H1

@tivie
Copy link
Member

tivie commented Apr 11, 2017

Yes, I know. But, according to the markdown spec, escaping with backslash is reserved for characters that have special meaning in markdown context, not HTML. < is a "normal" character to markdown, it has no special meaning.
In markdown, escaping with backslash tells the parser that it should ignore the character and leave it as it is. For example, \*\*foo\*\* will be parsed as **foo** and not <strong>foo</strong>.

There's also the problem with unintended escapes. Example: 'This sentence uses a backslash <strong>followed by a strong tag`

However, since GFM supports escaping html entities, this will be implemented as an option.

@ghost
Copy link
Author

ghost commented Apr 11, 2017

turns out, github has escape for EVERY punctuation symbol: https://github.github.com/gfm/#example-296

likely due to regex smth

@tivie
Copy link
Member

tivie commented Apr 11, 2017

Yeah, they changed it a bit in favor of commonmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant