Repository navigation
Clarify JavaScript encoding contracts and strengthen boundary tests - #244
Merged
Merged
Conversation
3 tasks done
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.
Change
The JavaScript documentation understated output growth and did not clearly define safe insertion boundaries. Clarify the Javadocs, guides, and matching JSP/Jakarta descriptions: preserve complete encoded results, avoid continuing JavaScript escapes or HTML character references, and distinguish nonempty-fragment protection from empty input or an already-started HTML end tag. Explain JSON whole-string embedding separately.
Document that the reported URL is unchanged by
forJavaScriptSourceandforJavaScriptAttribute, while general/block modes retain their script-letter escaping. Correct the internal XML/shortest-escape claims and describe opening<scripttokenizer transitions as well as closing tags.Strengthen parser regressions to assert the entire script text survives parsing, rather than relying on marker absence. Add empty-input, already-started-end-tag, and opening-script controls. Jsoup 1.23.2 differs from Chrome for mixed-case double-escape starts; the test documents this limitation and uses a lowercase raw negative control.
Related to #243.
Compatibility and validation
No executable encoder logic, emitted encoding, public API, or dependency changes. The patch corrects documentation and test coverage of the existing contract.
./mvnw -B -ntp clean verify: passed all reactor modules, including Javadoc generation; 2,290 Surefire/Failsafe tests, zero failures/errors/skips.python3 scripts/check-taglib-parity.py: passed, 34 source files.python3 -m unittest discover -s scripts/tests: 36 tests passed.python3 -m unittest discover -s compatibility/tests: 17 tests passed against the freshly built artifacts.git diff --check: passed.The final patch was built in an isolated checkout and verified byte-for-byte against this commit. The Docker/Selenium CI fixture and cross-JDK CI matrix were not run locally; required CI remains the merge gate. Local browser probes used Chrome, not Firefox or Safari.