Closed sophicshift closed 1 year ago
I just noticed Document
has a ToMarkup
instance that properly handles that when converting it to blaze's Markup
. Since Document
is also used for arbitrary XML, it makes sense that this renderText
issue is by design. So I'm closing this.
Consider this:
Semantically, the rendered Javascript is different from source, because inside of it content is assumed to be unscaped. The output should instead be:
<script>foo = 3 < 5</script>
.I understand all text in
Text.XML.Document
is assumed to be unscaped (countrary toData.XML.Types.Document
). So a render-side solution would be to check if text is inside certain elements (script included), and in such cases not escape it. This could be done during theText.XML.Document -> Data.XML.Types.Document
conversion by putting such text insideContentEntity
.