RFC: HTML Fallback Handling #99
Replies: 2 comments 2 replies
-
At work the markdown parser we use (a JS based one) defaults to escaping all html. This was fine until I proposed switching from using handlebars syntax for custom rendering to using a combination of vanilla html and custom elements. Turns out that the parser doesn't support html by default (which is nice), but it also doesn't support custom elements at all! Based on this experience I think an allow list would be the best approach for supporting html. Let the user define what they want. |
Beta Was this translation helpful? Give feedback.
-
I really like the way Jim Carlson handles something like this in his L1 markup demonstration https://www.youtube.com/watch?v=gqeqtZeDp18&t=120s - when his parser encounters unsupported syntax it simply adds an error object and keeps parsing. His renderer colors the error red along with the other rendered output so it's clear where the problem is. Am currently trying some experiments to see if I can find a way to simulate this with a catchall hander. |
Beta Was this translation helpful? Give feedback.
-
HTML Fallback Handling
Background
GFM has a feature to disallow specific raw HTML.
Should there be different ways to handle HTML tags with no HTML handler?
Some motivating cases:
type RawHtmlAllowed = Allowed | Disallowed
?Beta Was this translation helpful? Give feedback.
All reactions