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: Skip escaping if already escaped in the code tag. #606

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

shibomb
Copy link
Contributor

@shibomb shibomb commented Oct 18, 2024

Resolves #587

This is a proposal.
It seems to work well on the following page in my local env.
/reference/p5/createInput/
/reference/p5/Boolean/
/reference/p5/Number/

changes:

Check if the content is already escaped by looking for common HTML entities in code tag.
If already escaped, skip escaping.

@davepagurek
Copy link
Collaborator

This is a good fix for right now while we have stuff written in an inconsistent format. We should also address that at the source (details in #587 (comment)) but this will help us not have broken content in the mean time!

@davepagurek
Copy link
Collaborator

One note is that it means we can't easily write code in p5 explaining how HTML escaping works because if we try to explicitly write &lt; as I've done here, it would render as < in our docs. I think that's fine since we probably don't need to do that in p5, but once the source is addressed, the plan will be to remove this check again.

@davepagurek davepagurek merged commit a872651 into processing:main Oct 22, 2024
4 checks passed
@shibomb shibomb deleted the fix/code-double-escaped branch October 22, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reference shows html entity &amp; rather than ampersand
2 participants