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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 36 additions & 26 deletions spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -722,57 +722,64 @@ recognized as entity references either:
````````````````````````````````


Entity and numeric character references are recognized in any
context besides code spans or code blocks, including
URLs, [link titles], and [fenced code block][] [info strings]:
Entity and numeric character references are treated as literal
text in code spans and code blocks:
Comment on lines +725 to +726
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?


```````````````````````````````` example
<a href="&ouml;&ouml;.html">
`f&ouml;&ouml;`
.
<a href="&ouml;&ouml;.html">
<p><code>f&amp;ouml;&amp;ouml;</code></p>
````````````````````````````````


```````````````````````````````` example
[foo](/f&ouml;&ouml; "f&ouml;&ouml;")
f&ouml;f&ouml;
.
<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
<pre><code>f&amp;ouml;f&amp;ouml;
</code></pre>
````````````````````````````````



Entity and numeric character references are left uninterpreted
in HTML blocks and raw HTML:
Comment on lines +744 to +745
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.


```````````````````````````````` example
[foo]
<div id="&copy&asdf;">

[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"
Link <a href="&copy&ouml;&ouml;.html">
.
<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
<div id="&copy&asdf;">
<p>Link <a href="&copy&ouml;&ouml;.html"></p>
````````````````````````````````


Entity and numeric character references are recognized in any
any other context, including URLs, [link titles], and
[fenced code block][] [info strings]:
Comment on lines +757 to +759
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.


```````````````````````````````` example
``` f&ouml;&ouml;
foo
```
[foo](/f&ouml;&ouml; "f&ouml;&ouml;")
.
<pre><code class="language-föö">foo
</code></pre>
<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
````````````````````````````````


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

```````````````````````````````` example
`f&ouml;&ouml;`
[foo]

[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"
.
<p><code>f&amp;ouml;&amp;ouml;</code></p>
<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p>
````````````````````````````````


```````````````````````````````` example
f&ouml;f&ouml;
``` f&ouml;&ouml;
foo
```
.
<pre><code>f&amp;ouml;f&amp;ouml;
<pre><code class="language-föö">foo
</code></pre>
````````````````````````````````

Expand Down Expand Up @@ -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.

attributes:

```````````````````````````````` example
foo <a href="&ouml;">
foo <a href="&ouml;&copy">
.
<p>foo <a href="&ouml;"></p>
<p>foo <a href="&ouml;&copy"></p>
````````````````````````````````


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:


```````````````````````````````` example
foo <a href="\*">
Expand All @@ -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:


```````````````````````````````` example
<a href="\"">
.
Expand Down