Closed shibomb closed 1 month ago
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 https://github.com/processing/p5.js-website/issues/587#issuecomment-2422407707) but this will help us not have broken content in the mean time!
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 <
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.
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.