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

Example 116 expects broken HTML #511

Closed
ujifgc opened this issue Dec 3, 2017 · 2 comments
Closed

Example 116 expects broken HTML #511

ujifgc opened this issue Dec 3, 2017 · 2 comments
Milestone

Comments

@ujifgc
Copy link

ujifgc commented Dec 3, 2017

http://spec.commonmark.org/0.28/#example-116 introduced in #459 adds an example that requires to generate a broken HMTL.

Input:

<table><tr><td>
<pre>
**Hello**,

_world_.
</pre>
</td></tr></table>

Expected in the spec:

<table><tr><td>
<pre>
**Hello**,
<p><em>world</em>.
</pre></p>
</td></tr></table>

Suggested fix:

<table><tr><td>
<pre>
**Hello**,
<p><em>world</em>.</p>
</pre>
</td></tr></table>
@jgm
Copy link
Member

jgm commented Mar 25, 2018

The fact that this generates invalid HTML is not in itself a problem. You'll always be able to create invalid HTML by inserting raw HTML. And the example is flagged as a case where you get "surprising" results; this is almost certainly not something someone would do intentionally, but it's still useful to illustrate what the spec's rules call for here.

One thing that could be changed in our current rules: </td> starts a raw HTML block, per start condition 6, but </pre> does not. That may be surprising, but it's due to the special treatment of pre, style, and script in the start/end conditions.

If we added a condition that a line beginning with </pre> starts a raw HTML block, then we'd get the result you describe above.

@jgm jgm added this to the 0.29 milestone Aug 25, 2018
@jgm
Copy link
Member

jgm commented Mar 23, 2019

See #517
Since I recommend there that we let </pre> start a raw HTML block, I'll close this.

@jgm jgm closed this as completed Mar 23, 2019
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