Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Malformated HTML tags cause parsing error #51

Open
Goaman opened this issue Nov 28, 2019 · 5 comments
Open

Malformated HTML tags cause parsing error #51

Goaman opened this issue Nov 28, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@Goaman
Copy link
Contributor

Goaman commented Nov 28, 2019

Initialize the editor with:

<p><i>a</p> <p>b</i></p>

Will render:

<p><i>a</i></p><i>&nbsp;</i><p><i>b</i></p>

But if we place the <i> tag properly:

<i><p>a</p> <p>b</p></i>

It render:

<p><i>a</i></p><p><i>b</i></p>
@Goaman Goaman added the bug Something isn't working label Nov 28, 2019
@dmo-odoo
Copy link
Collaborator

Are you sure having a p inside a i is valid? I would not be surprised if the browser itself already corrects it into <p><i>a</i></p><p><i>b</i></p> on innerHTML so that part might not be a problem of our parser.

@Goaman
Copy link
Contributor Author

Goaman commented Nov 28, 2019

You are right, as the spec specify (https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-i-element). <i> element cannot exist outside a "phrasing context".

@dmo-odoo
Copy link
Collaborator

The nbsp is strange though, as they were not added by the browser when I tested it, so it looks like it might be our code that does that, which is surprising honestly...

@dmo-odoo
Copy link
Collaborator

Is this issue still accurate as of the current master ?

@Goaman
Copy link
Contributor Author

Goaman commented Mar 16, 2020

Yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants