diff --git a/src/wcc.js b/src/wcc.js index c6872393..f5043afd 100644 --- a/src/wcc.js +++ b/src/wcc.js @@ -188,7 +188,8 @@ function renderLightDomChildren(childNodes, iHTML = '') { ? '' : ``; } else if (nodeName === '#text') { - innerHTML += value; + // TODO what about legitimate < content? + innerHTML += value.replace(/ + <h1>Hello from the server rendered users page! 👋</h1> + + `, + [ + new URL('./src/components/ctc-block.js', import.meta.url) + ]); + + rawHtml = html; + }); + + it('should preserve HTML entities', function() { + expect(rawHtml).to.contain('<h1>Hello from the server rendered users page! 👋</h1>'); + }); + }); +}); \ No newline at end of file diff --git a/test/cases/light-dom-html-entities/src/components/ctc-block.js b/test/cases/light-dom-html-entities/src/components/ctc-block.js new file mode 100644 index 00000000..b86b693e --- /dev/null +++ b/test/cases/light-dom-html-entities/src/components/ctc-block.js @@ -0,0 +1,5 @@ +export default class CopyToClipboardBlock extends HTMLElement { + +} + +customElements.define('x-ctc', CopyToClipboardBlock); \ No newline at end of file