Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34791

Re: The less sign "<" in script elements

From Martin Honnen <martin.honnen@gmx.de>
Newsgroups comp.lang.javascript
Subject Re: The less sign "<" in script elements
Date 2018-03-18 21:07 +0100
Organization Liberty Development
Message-ID <p8mgur$n0j$1@news.albasani.net> (permalink)
References <less-20180318165920@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 18.03.2018 17:08, Stefan Ram wrote:
>    I remember that there was a time when I had to escape a
>    less-sign "<" that was contained within a script element.
> 
>    I assume that this is not necessary anymore in HTML5,
>    while »CDATA« must be used in XHTML, including XHTML5.
> 
>    So, is my memory correct that in HTML 2, HTML 3 and/or
>    HTML 4, one had to escape a less sign in a script element,
>    using, e.g., »&#60;«? E.g., for a comparison like »x<y«?

Certainly not with HTML 4 as it explicitly says in 
https://www.w3.org/TR/html401/appendix/notes.html#notes-specifying-data

  The DTD defines script and style data to be CDATA for both element 
content and attribute values. SGML rules do not allow character 
references in CDATA element content

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: The less sign "<" in script elements Martin Honnen <martin.honnen@gmx.de> - 2018-03-18 21:07 +0100

csiph-web