Skip to content

bug/preserve light dom html entities in text nodes#182

Closed
thescientist13 wants to merge 2 commits intomasterfrom
bug/preserve-light-dom-html-entities
Closed

bug/preserve light dom html entities in text nodes#182
thescientist13 wants to merge 2 commits intomasterfrom
bug/preserve-light-dom-html-entities

Conversation

@thescientist13
Copy link
Copy Markdown
Member

@thescientist13 thescientist13 commented Jan 7, 2025

Related Issue

ProjectEvergreen/greenwood#1375

Summary of Changes

  1. Naive implementation for preserving HTML entities in text nodes
  2. Add test case

TODO

  1. Should we handle > too? Others?
  2. Would this not "mangle" legitimate uses of < too?

Regarding the second point above, it seems through the serialization process parse5 will even encode legitimate < even when not using our replace function? 🤔

{
  value: '\n' +
    '          <h1>Hello from the server rendered users < page! 👋</h1>\n' +
    '        '
}
{
  html: '\n' +
    '        <x-ctc>\n' +
    '          <h1>Hello from the server rendered users &lt; page! 👋</h1>\n' +
    '        </x-ctc>\n' +
    '        '
}

@thescientist13
Copy link
Copy Markdown
Member Author

confirmed that #178 seems to fix this issue completely as confirmed in ProjectEvergreen/greenwood#1376 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant