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

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

thescientist13
Copy link
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' +
    '        '
}

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