aurelia / framework

The Aurelia 1 framework entry point, bringing together all the required sub-modules of Aurelia.
MIT License
11.76k stars 623 forks source link

issue with repeat.for using p tags with hr inside #842

Closed obedm503 closed 6 years ago

obedm503 commented 7 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: the repeater breaks when using a p tag with an hr tag inside it

Expected/desired behavior:

to not break and generate correct html https://codepen.io/anon/pen/rYZLZB?editors=1010 using codepen because gist.run is outdated. wasn't able to test on the latest version (1.1.5) because cdnjs only has version 1.0.2, although the bug still happens on my local project using aurelia-framework 1.1.2

what caught my attention is that the same template works flawlessly if I used a div instead of a p, or if I used a p without an hr inside. the linked codepen demos several situations compared to using a div

obedm503 commented 7 years ago

/cc @lstarky

AshleyGrant commented 7 years ago

Well, it definitely looks like a bug. @jdanyow what do you think?

jdanyow commented 6 years ago

It has to do with how the browser is parsing <template><p><hr></p></template>

Compare what the alert displays with the source html: https://gist.run/?id=fdaeb456bcf33ff5c3d48009eea7100b

Reproduces in firefox too.

jdanyow commented 6 years ago

aurelia gist is up to date: https://gist.run/?id=7542e061bc940cde506b

obedm503 commented 6 years ago

Why is this closed? Is it a browser bug then?

StrahilKazlachev commented 6 years ago

It's not a browser bug, you can not have <hr> inside of <p> - check Permitted content of <p> and the Content categories of <hr>. At least this is how I understand the spec.

obedm503 commented 6 years ago

woah

this is pretty mind blowing. but at least it's not a bug 😅