Skip to content
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

Lowercase <![cdata[]]> incorrectly parsed in inlines #193

Closed
wooorm opened this issue Aug 3, 2020 · 1 comment
Closed

Lowercase <![cdata[]]> incorrectly parsed in inlines #193

wooorm opened this issue Aug 3, 2020 · 1 comment

Comments

@wooorm
Copy link

wooorm commented Aug 3, 2020

Spec does not mention that lowercase should be ok, rather, to me it reads as if it should not be allowed: https://spec.commonmark.org/0.29/#cdata-section.
The “Block” version of commonmarkjs behaves correctly and does not allow lowercase, but because of the single regex to parse “inline” html, it’s allowed.

Input:

<![cdata[]]>

Yields:

<p><![cdata[]]></p>

Expected:

<p>&lt;![cdata[]]&gt;</p>
@esuomi
Copy link

esuomi commented Nov 22, 2020

CDATA is defined by the Extensible Markup Language (XML) 1.0 W3C Recommendation section #2.7 to always start with the static string <![CDATA[, using that exact capitalization.

While not exactly relevant, the why for capitalization is probably a carryover from early times of computing before even ARPANET was a thing; Decades ago when everything was text-based and terminals had a varying levels of features (colors, charsets, row length, bandwidth etc.) one of the neatest tricks to detect feature compatibility automatically was to check username capitalization during login. Computers started as caps only, lowercase came later, so having an user submit their username as lowercase meant a more modern baseline of features for the terminal connection.

@jgm jgm closed this as completed in 47ef9d7 Dec 5, 2020
taku0 added a commit to taku0/cmark-el that referenced this issue Apr 3, 2021
The spec specifies uppercase for declarations and cdata.

Closes commonmark/commonmark.js#193.

commonmark/commonmark.js@47ef9d7
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Fri Dec 4 21:18:56 2020 -0800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants