-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDATA sections are being HTML-escaped #758
Comments
Yes, CDATA sections are currently not supported. |
So what would it take to implement CDATA? They are an alternative to normal text nodes and can be mixed. They could also simply be resolved to text nodes, which means that the text data would then be escaped on output. |
@cabo I'm not very familiar with CDATA sections. Are you saying
|
CDATA is just a way to avoid having to escape every XMLy character within a section of content. You can treat CDATA sections as an extra node, like an XML parser would do, or you can dissolve the CDATA section into text, what is probably what makes more sense to kramdown ecosystem. |
Yes.
Yes. The "bug" for me is that the CDATA markup ( |
ChatGPT says: (slightly corrected by me): CDATA stands for "character data" and is used in XML to enclose text that should be treated as raw character data, rather than markup. In XML, markup symbols like '<' and '>' have special meanings and are used to define elements, attributes, and other structural components of the document. However, there may be cases when you want to include text that contains these symbols without them being interpreted as markup. CDATA sections are a way to include such text in an XML document. They are enclosed within a pair of CDATA section markers that look like this: For example, consider the following XML snippet: <description>
<![CDATA[
<h2>Product Description</h2>
<p>This is a <em>fantastic</em> product!</p>
]]>
</description> In this example, the text within the CDATA section is CDATA sections can be used for any kind of character data that may contain special characters that could be misinterpreted as markup. Common use cases include including code snippets or scripts within an XML document, or including HTML content within an XML document. |
kramdown seems to treat CDATA like normal text in XML (HTML) parts of a markdown input.
Actually, I cannot find any CDATA processing on the input side of the kramdown parser.
The text was updated successfully, but these errors were encountered: