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

fix: don't decode HTML entities (&foo;) until rendering #465

Merged
merged 4 commits into from
Dec 20, 2022

Conversation

robertvanhoesel
Copy link
Contributor

I noticed my status containing an unclosed (some <text> ...) html tag cause the status to be displayed with just some (live example expected / actual )Effectively the parses has a line decodes the raw some &gt;text&lt; into raw HTML which causes a new tree child, while afaik it should only decode these entities while rendering.

[/&[^;]+;/g, (val: string) => decode(val)],

This PR moves the decoding to the render step. I extensively tested different types of content including MD codeblocks and this seems to do the trick.

I attempted to set up a test but couldn't get nr test to work inside Codeflow due to missing pnpm.

This fixes #346 and fixes #353, not sure if or how it impacts #256

@robertvanhoesel robertvanhoesel added the c: bug Something isn't working label Dec 19, 2022
@stackblitz
Copy link

stackblitz bot commented Dec 19, 2022

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Dec 19, 2022

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit ea55b9e
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/63a0fee2e59a370009a1b1ea
😎 Deploy Preview https://deploy-preview-465--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu requested a review from danielroe December 19, 2022 21:03
@danielroe danielroe changed the title Don't decode HTML entities (&foo;) until rendering fix: don't decode HTML entities (&foo;) until rendering Dec 20, 2022
@danielroe
Copy link
Member

Thank you ❤️

@danielroe danielroe merged commit f8ebc0e into main Dec 20, 2022
@danielroe danielroe deleted the robertvanhoesel/patch-92204 branch December 20, 2022 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rendering <input> element within a status Should not remove arbitrary html-tag-like text
2 participants