Markwon icon indicating copy to clipboard operation
Markwon copied to clipboard

Please,add support for hiding unknown tags

Open hakobyan1221 opened this issue 3 years ago • 5 comments

  • Markwon version: 4.6.2
  1. HtmlPlugin parses all tags.
  2. Please, add support to parse and show only those tags that are predefined in INLINE_TAGS or BLOCK_TAGS or VOID_TAGS.

hakobyan1221 avatar Nov 24 '21 15:11 hakobyan1221

Hello @hakobyan1221 ,

would you say you need to parse only standard HTML tags and keep the rest untouched? It is not something that could be done easily. But it seems you might have better results by escaping non-standard HTML tags instead

noties avatar Dec 06 '21 11:12 noties

Can you,please, tell how it's possible to skip non-standard HTML tags?

hakobyan1221 avatar Dec 06 '21 11:12 hakobyan1221

For example, you could have a list of allowed tags. Then, before sending your markdown to the parser you could process it to substitute the < character to the &lt;. This way HtmlParser won't be involved and your input for unlisted tags would be the same

noties avatar Dec 06 '21 22:12 noties

For example, you could have a list of allowed tags. Then, before sending your markdown to the parser you could process it to substitute the < character to the &lt;. This way HtmlParser won't be involved and your input for unlisted tags would be the same

But in that case all html tags won't be processed by parser

hakobyan1221 avatar Dec 07 '21 05:12 hakobyan1221

Yes, this is why you would need to process only non-supported tags. And ignore tags that should still be sent to the parser

noties avatar Dec 07 '21 23:12 noties