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

clarify that character references are not interpreted in HTML blocks and raw HTML #690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsc
Copy link

@rsc rsc commented Sep 4, 2021

The wording in section 2.5 implied otherwise,
although an example in 6.6 did clarify.
Adjust the first to remove the false implication
and adjust the second from saying "preserved",
which might mean they have to be parsed first,
to "copied uninterpreted".

The diff makes a bit of a hash of the changes,
which are to move the "unrecognized" cases
above the recognized ones, as suggested in #687.

Fixes #687.

…and raw HTML

The wording in section 2.5 implied otherwise,
although an example in 6.6 did clarify.
Adjust the first to remove the false implication
and adjust the second from saying "preserved",
which might mean they have to be parsed first,
to "copied uninterpreted".
Comment on lines +725 to +726
Entity and numeric character references are treated as literal
text in code spans and code blocks:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Entity and numeric character references are treated as literal
text in code spans and code blocks:
Entity and numeric character references are treated literally
in code spans and code blocks:

I think “text” might be a bit confusing as there’s the connotation with “Textual content”. Characters in this context, is confusing too. So many like this?

Comment on lines +744 to +745
Entity and numeric character references are left uninterpreted
in HTML blocks and raw HTML:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Entity and numeric character references are left uninterpreted
in HTML blocks and raw HTML:
Entity and numeric character references are not interpreted
in HTML blocks and raw HTML:

Personally I think this suggestion is clearer, but I don’t have strong opinions on it.

Comment on lines +757 to +759
Entity and numeric character references are recognized in any
any other context, including URLs, [link titles], and
[fenced code block][] [info strings]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Entity and numeric character references are recognized in any
any other context, including URLs, [link titles], and
[fenced code block][] [info strings]:
Entity and numeric character references are recognized in any
other context, including URLs, [link titles], and
[fenced code block][] [info strings]:

Double any.

@@ -9173,17 +9180,17 @@ foo <![CDATA[>&<]]>
````````````````````````````````


Entity and numeric character references are preserved in HTML
Entity and numeric character references are copied uninterpreted in HTML
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Entity and numeric character references are copied uninterpreted in HTML
Entity and numeric character references are not interpreted in HTML

Same as my earlier reasoning.

````````````````````````````````


Backslash escapes do not work in HTML attributes:
Backslash escapes are also copied uninterpreted:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Backslash escapes are also copied uninterpreted:
Backslash escapes are also not interpreted:

@@ -9192,6 +9199,9 @@ foo <a href="\*">
````````````````````````````````


Not interpreting backslash escapes can mean not recognizing
a tag that HTML5 would recognize:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not a fan of this sentence: HTML(5) definitely does recognise this. It’s a “valid” but weird link to \ and an attribute " (w/o value).

Perhaps better to say something along the lines of:

As backslash escapes are a markdown thing, and not an HTML thing,
they are not interpreted in HTML:

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

Successfully merging this pull request may close these issues.

example 31 is misplaced and unexplained
2 participants