webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.14k stars 167 forks source link

Pre tag misrendering inside template tag #411

Open mohamedafzal03 opened 3 years ago

mohamedafzal03 commented 3 years ago

Description

when we try to render a <pre> which is direct children of <p> tag , the browser rendering <pre> tag as sibling of <p> tag which is expected behaviour in chrome and I.E browsers. But when we wrap the <pre> tag inside a <template> tag and tried to render it . now <pre> tag renders inside <template> tag in chrome but it renders outside in I.E browser.

Steps to reproduce

var div = document.createElement("div"); div.setAttribute("id","pre-issue"); div.innerHTML = "<p><template><pre>this is pre tag</pre></template></p>"; document.body.appendChild(div); console.log(document.getElementById("pre-issue").innerHTML); the output differs as follows In chrome: <p><template><pre>this is pre tag</pre></template></p> In IE: <p><template></template><pre>this is pre tag</pre><p></p>

Browsers affected

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.