←back to thread

Element: setHTML() method

(developer.mozilla.org)
205 points todsacerdoti | 2 comments | | HN request time: 0.429s | source
Show context
michalpleban ◴[] No.45674843[source]
So is this basically a safe version of innerHTML?
replies(2): >>45674953 #>>45677088 #
intrasight ◴[] No.45677088[source]
I'm confused as to why you need a "safe" version if you're the one generating and injecting the HTML.
replies(6): >>45677311 #>>45677377 #>>45678388 #>>45678704 #>>45679220 #>>45679443 #
1. theendisney ◴[] No.45678388[source]
It was kind of strange to have bbcode and wiki markup specifically to avoid allowing users to use html.
replies(1): >>45678759 #
2. masklinn ◴[] No.45678759[source]
Gruber’s original markdown tool passes HTML straight through, it was designed to make writing long-form content easier.

Markdown implementations can do any of that, only allowing a whitelist of HTML elements (GFM), or not allowing HTML at all.