Open grantfitzsimmons opened 1 year ago
note, executing arbitrary html is dangerous (Cross-site scripting (XSS) and HTML injection)
the HTML code MUST be sanitized before being outputted to remove unsafe tags (<script>
, onerror=""
, ...)
there are libraries that can do that. fortunately, there is now also an experimental API that can do that - https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API
@grantfitzsimmons can we expect users to be able to write HTML? or do we need a wysiwyg editor too?
I was asking the same questions with @melton-jason yesterday, Both about my concern about executing arbitrary HTML and what kind of interface they would enter this information with.
I think we'd need to have a wysiwyg editor, but we could keep it simple at first if we make this work for chemical formulas only.
fyi: MathML is finally supported by all major browsers there should be editors out there that support it - https://developer.mozilla.org/en-US/docs/Web/MathML/Authoring#wysiywg_editors
So things like this
are rendered correctly when the form definition tells it to