Repository navigation
Preserve noprotect when changing the p5.js library version - #4312
Closed
dyk1454683243-sudo wants to merge 1 commit into
Closed
dyk1454683243-sudo wants to merge 1 commit into
dyk1454683243-sudo wants to merge 1 commit into
Conversation
Version and addon HTML rewrites serialize via documentElement.outerHTML, which drops comments outside <html> and flips the Loop Protection toggle. Restore the existing <!-- noprotect --> flag after serialization. Fixes processing#4303 Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Author
|
Withdrawing this PR while I clean up a high-volume open-PR backlog. Sorry for the noise — happy to come back later with a focused change if useful. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
Fixes #4303
Changing the p5.js library version in Preferences rewrites
index.htmlthroughdocumentElement.outerHTML. That serialization drops comments outside<html>, including a leading<!-- noprotect -->, so Loop Protection Off flips back to On. The same rewrite path is used by addon toggles.Demo:
No visual UI change. Loop Protection Off (
<!-- noprotect -->present) now survives a library version change; Loop Protection On still does not insert a noprotect comment.Changes:
preserveNoProtect()so HTML rewrites keep an existing noprotect comment and do not invent one.useP5VersionserializeResult(), whichreplaceVersionand the addon setters already share.handleLoopProtection(true)still removes noprotect throughtoggleLoopProtectionand is unchanged.replaceVersionkeeps it; without → stays without; addon setters do not drop it.This is a separate branch from #4309 / #4311.
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #4303