I’m pretty sure <![CDATA[...]]> sections can be used in XHTML5, but what about HTML5?
I’m pretty sure <![CDATA[…]]> sections can be used in XHTML5, but what about HTML5?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
CDATAstructure isn’t really for HTML at all, it’s for XML.People sometimes use them in XHTML inside
scripttags because it removes the need for them to escape<,>and&characters. It’s unnecessary in HTML though, sincescripttags in HTML are already parsed like CDATA sections.Edit: This is where we open that really mouldy old can of worms from 2002 over whether you’re sending XHTML as
text/htmlor asapplication/xhtml+xmllike you’re “supposed” to 🙂