How to escape html tag?
See original GitHub issueHi,
Is it possible to escape some html tag, or in another word, is it possible to only process some specified html tags? For example, I have below markdown:
<script>alert('hello');</script> script tag
<tag> unknown tag
<img src="abc.png" />
the html generated is:
<script>alert('hello');</script> script tag\n
<p><tag> unknown tag</p>
<img src="abc.png" />
while I’m expecting to get result like:
<script> alert('hello');</script> script tag\n
<p><tag> unknown tag</p>
<img src="abc.png" />
It would be great if there is an option to tell Flexmark to only process some specified tags, like img, a, but escape all others.
Best regards
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Escape tags in html - Stack Overflow
Those escapes are decimal ascii escapes. You can see the values here. Take a look at the HTML column.
Read more >Guide to: Using HTML Tags/Characters in Labels
Escape characters will always begin with the ampersand symbol (&) and end with a semicolon symbol (;). The characters in between the ampersand...
Read more >How to escape & unescape HTML characters in string in ...
Escaping HTML characters in a string means replacing the: ... We can escape the HTML of the string using the replace method of...
Read more >How to Escape HTML Characters - Techstacker
How to Escape HTML Characters · Replace < with < · Replace > with > · Replace " with ".
Read more >How to escape everything in a block in HTML ? - GeeksforGeeks
Escaping is a method that permits us to inform a computer to try to do something special with the text we supply or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nanodeath, HTML applies to all HTML elements: block, block comments, inline and inline comments.
Markdown block HTML consists of HTML block tags that start a paragraph, inline HTML is any HTML that is part of a paragraph.
Block HTML: http://spec.commonmark.org/0.27/#html-blocks
inline HTML: http://spec.commonmark.org/0.27/#raw-html
Thank you!