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

Error compiling template, even though one root element #6170

Closed
eu81273 opened this issue Jul 20, 2017 · 4 comments
Closed

Error compiling template, even though one root element #6170

eu81273 opened this issue Jul 20, 2017 · 4 comments
Labels

Comments

@eu81273
Copy link

@eu81273 eu81273 commented Jul 20, 2017

Version

2.4.1

Reproduction link

https://jsfiddle.net/k5h2fvqh/

Steps to reproduce

  1. <p> tag as Root element
  2. put <div> tag as child element

What is expected?

Render template correctly

What is actually happening?

Error compiling template with message "Component template should contain exactly one root element"

@nickmessing
Copy link
Member

@nickmessing nickmessing commented Jul 20, 2017

Here's minimal repro: https://jsfiddle.net/gq2ckLLf/

@nickmessing
Copy link
Member

@nickmessing nickmessing commented Jul 20, 2017

That is exected behaviour, <p> tag can not have child <div> (and other blocks too) so <p><div></div></p> is parsed as <p></p><div></div></p> and as you can see it's more than one root element. That's HTML limitations.

P.S. More information available here

@nickmessing
Copy link
Member

@nickmessing nickmessing commented Jul 20, 2017

Complete list of elements that "close" <p> is available here

@juliolimareis
Copy link

@juliolimareis juliolimareis commented Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants