5/17/2023 0 Comments Codebox html![]() ![]() So as long as the raw snippet code does not violate rule 1 (that one can't Thus no matter what, textarea needs a hefty entity translation handler orĬDATA (Character Data) will not treat tags inside the text as Occurrences of the string "), or U+002F SOLIDUS (/). The text in raw text and RCDATA elements must not contain any The current HTML5 spec says the textarea is now a RCDATA field and (quote): BUT entities are still expanded, so they and 'ambiguous Text as markup (but are still governed by rule 1), so one doesn't need toĮncode ). ![]() RCDATA (Replaceable Character DATA): will not not treat tags inside the '.But a textarea seems to work.', yes, either because of the browsersĮrror-engine trying to make something out of it, or because HTML5: Objective's scope of embedding a raw snippet in the markup. Needless to say, encoding/escaping this many characters falls outside this Inside the snippet, you also have to encode all ) characters So not only do you need to encode all the container's closing character-sequences Most tags like body, div, pre, etc, but also textarea (until close italics with ''-tag, where it is obvious one should escape/encode (something in) depending on markup language/version). ( During this post I'll refer to this as rule no 1.) So, to embed any kind of raw code/snippet inside your markup-language, one will always have to escape/encode every instance (inside that snippet) that resembles the character(-sequence) that would close the wrapping 'container' element in the markup. (polyglot)(x)(ht)ml Markup-languages rely on wrapping (almost) everything between begin/opening and end/closing tags/character(sequences). (I know, that are 3 contradicting answers, so read on.) The short (but) ambiguous answer is: you can't.
0 Comments
Leave a Reply. |