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

Inconsistent behavior for inline html tags #684

Closed
meteorlxy opened this issue Jul 5, 2021 · 1 comment
Closed

Inconsistent behavior for inline html tags #684

meteorlxy opened this issue Jul 5, 2021 · 1 comment

Comments

@meteorlxy
Copy link

We have some examples for raw html:

commonmark-spec/spec.txt

Lines 9006 to 9030 in ab56f2e

```````````````````````````````` example
<a><bab><c2c>
.
<p><a><bab><c2c></p>
````````````````````````````````
Empty elements:
```````````````````````````````` example
<a/><b2/>
.
<p><a/><b2/></p>
````````````````````````````````
Whitespace is allowed:
```````````````````````````````` example
<a /><b2
data="foo" >
.
<p><a /><b2
data="foo" ></p>
````````````````````````````````

Which shows that it is supported to split a html tag into multiple lines. However, there is an inconsitent behavior when spliting a <img> tag:

image

Reproduce link

  • When writing in a single line, it's recognized as a html block.
  • When writing in multiple lines, it's recogized as inlined html.

I could find a related issue #492

@jgm
Copy link
Member

jgm commented Jul 5, 2021

This isn't inconsistent; it is just following the spec.
Have a look at the spec for raw HTML blocks.

Your first example is a type 7 HTML block.

Your second example is not an HTML block. (Note that img isn't in the list for type 6.)

@jgm jgm closed this as completed Jul 5, 2021
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