You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What information was incorrect, unhelpful, or incomplete?
The terminology is imprecise. It refers to reserved characters, where in fact HTML refers to things that aren't allowed in particular contexts. For example you can happily use a < as long as you don't use it in a way that a browser might interpret as a tag. Similarly " chars are allowed in many places, but not inside tag attributes that are defined using them. We should talk about problematic characters and explain this a bit better.
Some characters are allowed in any context according to the spec, such as & but can be misused - for example if used as the start of a character reference, the reference should be valid. Also, anecdotally some browsers complain if & is used in pre and isn't followed by a character reference (that looks to be off-spec).
The doc is focused on the use of <pre> to get layout you want, which is reasonable. But it doesn't cover the fact that the element can contain tags and have other formatting. A main use is not just layout of pretty images, but probably generating layout to syntax-highlight code - and that requires some use of tags etc.
The section on Escaping reserved characters needs a little more nuance. Firstly to capture contexts when they are are not allows. Also, from Too many clicks to obtain HTML char entity names #34383 (comment) to capture some concerns about automatic replacement of reserved characters. At high level this is again to note that what is reserved character depends on context, secondly that if you are going to do any form of replacement then & has to be done first so that any "already replaced characters" are not double-replaced, and lastly note that because of all what needs to be escaped depends on context, generally a manual update is safer.
What did you expect to see?
More nuance. Terminology to change from "reserved" to "problematic", or "special" characters.
Do you have any supporting links, references, or citations?
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre
What specific section or headline is this issue about?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre#escaping_reserved_characters
What information was incorrect, unhelpful, or incomplete?
<
as long as you don't use it in a way that a browser might interpret as a tag. Similarly"
chars are allowed in many places, but not inside tag attributes that are defined using them. We should talk about problematic characters and explain this a bit better.&
but can be misused - for example if used as the start of a character reference, the reference should be valid. Also, anecdotally some browsers complain if&
is used in pre and isn't followed by a character reference (that looks to be off-spec).<pre>
to get layout you want, which is reasonable. But it doesn't cover the fact that the element can contain tags and have other formatting. A main use is not just layout of pretty images, but probably generating layout to syntax-highlight code - and that requires some use of tags etc.What did you expect to see?
More nuance. Terminology to change from "reserved" to "problematic", or "special" characters.
Do you have any supporting links, references, or citations?
This came from a discussion in #34383
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: