Skip to content

Fix inline <code> escaping in reference pages#1164

Merged
ksen0 merged 5 commits intoprocessing:mainfrom
rakesh2OO5:fix/issue-lt-gt
Mar 4, 2026
Merged

Fix inline <code> escaping in reference pages#1164
ksen0 merged 5 commits intoprocessing:mainfrom
rakesh2OO5:fix/issue-lt-gt

Conversation

@rakesh2OO5
Copy link
Contributor

@rakesh2OO5 rakesh2OO5 commented Feb 11, 2026

Fixes #1163

Escaping was not being lost during reference data generation (confirmed in the main p5.js repo). The generated docs/reference/data.json already contains properly escaped HTML.

The issue occurred during rendering in p5.js-website, where inline code containing HTML was being reinterpreted and losing escaped entities.

This PR enables xmlMode in Cheerio within escapeCodeTagsContent to ensure escaped entities inside inline code are preserved.

Multiline pre/code blocks remain unaffected.

Tested locally on affected reference pages including createDiv, attribute, center, and child.

@rakesh2OO5
Copy link
Contributor Author

@ksen0 just a gentle ping on this PR when you have time.

All checks are passing. Please let me know if any changes are needed.

Thanks!

@ksen0
Copy link
Member

ksen0 commented Mar 3, 2026

Hi @rakesh2OO5, this change looks good! Thanks for fixing, and for your patience. Will merge this PR now

@rakesh2OO5
Copy link
Contributor Author

@ksen0 thanks for the review! Just a quick ping in case the merge step was missed.

@ksen0
Copy link
Member

ksen0 commented Mar 4, 2026

@reshma045 ah, sorry, yes, thanks for the ping

@ksen0 ksen0 merged commit 256581d into processing:main Mar 4, 2026
4 checks passed
@ksen0
Copy link
Member

ksen0 commented Mar 4, 2026

@rakesh2OO5 Could you make the same change in a PR targeting the 2.0 branch as well please? I have some merge conflicts with my normal cherry-pick method. (The 2 branches are quite different, that's part of what bottlenecks merging on this repository. The aim is to normalize them a bit more in a few months.)

@rakesh2OO5
Copy link
Contributor Author

rakesh2OO5 commented Mar 4, 2026

@ksen0 , I've opened a PR targeting the 2.0 branch as well: #1217

@rakesh2OO5 rakesh2OO5 deleted the fix/issue-lt-gt branch March 4, 2026 19:19
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.

Some reference entries do not display &lt; &gt; as expected

2 participants