-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Scripts: Use HTML API to build SCRIPT tags #10639
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
Closed
sirreal
wants to merge
121
commits into
WordPress:trunk
from
sirreal:scripts/use-html-api-for-script-tags
Closed
Changes from all commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
4a8ca98
Auto-escape JavaScript and JSON script tags when necessary
sirreal 4a28ef2
Update ticket number
sirreal 0bef687
Fix those lints
sirreal cdba027
No trailing function commas
sirreal ba54ae4
Remove JSON_THROW_ON_ERROR constant
sirreal a697e9e
fixup! Remove JSON_THROW_ON_ERROR constant
sirreal 2b3d0d0
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 8246439
Remove JSON +json subtype handling
sirreal 1b6b4fd
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal b3e88e8
Add test for scripts containing script tags
sirreal 27c6371
Update wp_add_inline_script to use HTML API
sirreal deebd54
Use the tag processor for all the inline script tags
sirreal d78cd35
Remove assertions
sirreal c29c3d9
PICKME: Update Script Modules tests to use assertEqualHTML
sirreal abeebd6
Revert "Remove assertions"
sirreal aaacd6f
Merge branch 'trunk' into scripts/use-html-api-for-script-tags
sirreal 3f7f227
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 1362451
Add JS and JSON script tag tests
Copilot 8d30680
Fix typo in comment
sirreal 3b5ef4e
Improve comment
sirreal f8cfdf9
Clean up and fix tests
sirreal 501d201
Clean up and improve type/language logic
sirreal 253b971
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal bcc02ae
Fix svg SCRIPT tag tests
sirreal ea03441
Add todo on MIME type parsing
sirreal c7d1827
Update since tags 🤞
sirreal a134e82
Make is_{javascript,json}_script_tag methods private
sirreal d4bd4b3
Add language whitespace test
sirreal edae8d5
How'd that extra space get there, remove it!
sirreal 02ca3c0
Name search parts
sirreal d058a78
Clean up escaping tests
sirreal dfb63af
Add ignore and todo tags to new private is_*_script_tag functions
sirreal 11f51c9
Improve example comment
sirreal a3e0e27
Update regex comment with named groups
sirreal 288b952
Add details to "other" failure to escape comment
sirreal a7495dd
Improve consistency of comment quoting and differentiate types of dou…
sirreal 614916d
Describe JavaScript escaping strategy in detail
sirreal 5828382
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal d8c320c
Describe JavaScript escaping strategy in detail
sirreal 016a29f
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal 369eefc
Use the updated_html value in round-trip test
sirreal d67749d
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal 2869880
Revert changes to wp_add_inline_script
sirreal d6bfdca
Remove debugging assertions
sirreal b7099e4
fixup! Revert changes to wp_add_inline_script
sirreal 010a2a2
Switch to assertEqualHTML assertions
sirreal ab53486
Update defer/async boolean attributes
sirreal 3ba2267
Use Tag Processor in wp_get_script_Tag
sirreal 64a23b7
Add utility for semantically comparing a SCRIPT tag within HTML
sirreal c920821
Use script tag comparison in tests
sirreal dbd9f55
Remove more async=async and defer=defer
sirreal 7bef55a
fixup! Use script tag comparison in tests
sirreal 4333300
fixup! Add utility for semantically comparing a SCRIPT tag within HTML
sirreal 504a928
fix lint
sirreal 55d4e47
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 1c84037
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal 2ef0bf0
Fix demonstration comment
sirreal cb6b990
Extract and document escaping functions
sirreal da28eec
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal e399bf6
Tweak workaround documentation
sirreal 83c1fab
Add ASCII chart about HTML script tags with original source
sirreal 1872681
Improve linking between escapes
sirreal 83ff62f
Fix comments, typos, lints
sirreal 5979782
fixup! Fix comments, typos, lints
sirreal d469ae4
fixup! fixup! Fix comments, typos, lints
sirreal 402ae9f
Fix \c -> \r (carriage return) typo
sirreal 6b2c9ba
Add note about not parsing MIME types for JS script tags
sirreal eef0ccb
Add todo comment to is_json_script_tag
sirreal 71d2686
Re-order tag name termination chars to match elsewhere
sirreal d4693a2
Fix typo
sirreal eb4e091
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 4c3b0b2
Update comments on tag prefixes matching search pattern
sirreal 40015c9
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal bfa60cf
Use content-type identification and escape without PCRE
dmsnell 3252160
fixup! Use content-type identification and escape without PCRE
dmsnell 0b9b2bd
fixup! Use content-type identification and escape without PCRE
dmsnell b2533e1
fixup! Use content-type identification and escape without PCRE
dmsnell ddeb301
fixup! Use content-type identification and escape without PCRE
dmsnell b36fc32
fixup! Use content-type identification and escape without PCRE
dmsnell 1249af0
fixup! Use content-type identification and escape without PCRE
dmsnell 645cb45
Update escaping comment
sirreal f23b35b
Fix off-by-one repeat processing after script
sirreal 31cefb7
Restructure escaping logic
sirreal 25279e3
Merge and remove duplicate script tag content type tests
sirreal 6660196
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal b436e71
Editing review of the escaping method docblock.
dmsnell 95259d2
Fixup: Missed a couple of box drawing connections.
dmsnell 91c019d
Fixup: Missed a curved corner
dmsnell 09e3aa2
Tweak language in JS escaping comments
sirreal 30d7747
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal c1c6067
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 292614d
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal 6a6e1cc
Append trailing newline to output HTML not input
sirreal 3f1ba32
Update dot script to clean up fonts, align labels, etc...
dmsnell f7715fd
Update note in `set_modifiable_text()` now that `</script` is allowed
dmsnell 1015ace
Inline escaping to avoid WPCS-mandated misalignment.
dmsnell 59ccdc1
Expand the explanation for why other strings are rejected
dmsnell ef34aa1
Explain that there are non-HTML SCRIPT tags.
dmsnell d018cdf
Wording changes to comment.
dmsnell c59028e
Make escape_javascript_script_contents private
sirreal ae14a44
Merge branch 'trunk' into html-api/auto-escape-javascript-json
sirreal 6a5bc56
Tweak some langauge in "other" escaping
sirreal df2f663
fixup! Tweak some langauge in "other" escaping
sirreal adeb155
Merge branch 'html-api/auto-escape-javascript-json' into scripts/use-…
sirreal e884759
Merge branch 'trunk' into scripts/use-html-api-for-script-tags
sirreal 8b11027
Merge branch 'trunk' into scripts/use-html-api-for-script-tags
sirreal 1af9b2f
Add test for behavior of wp_get_inline_script_tag()
sirreal 00c49a5
Add matching tests for wp_get_script_tag()
sirreal 13141bc
Merge branch 'script-test-attribute-behavior' into HEAD
sirreal 8789ace
Fix script attribute order and type handling
sirreal 3858d8e
Use the force, Jon??
dmsnell 0197abc
Document suprprising de-duplication
dmsnell 8047003
Merge branch 'trunk' into script-test-attribute-behavior
sirreal f2ea738
Merge branch 'script-test-attribute-behavior' into scripts/use-html-a…
sirreal 1be946e
Merge branch 'trunk' into scripts/use-html-api-for-script-tags
sirreal cea5f04
Add _doing_it_wrong in case script contents are unsafe
sirreal 67ba19e
Improve function documentation
sirreal ed73a44
Return empty string in case the content is unsafe and cannot be escaped
sirreal faf77e3
Apply return type description suggestion
sirreal 36537d9
Fix language in comments
sirreal 049332a
Merge branch 'trunk' into scripts/use-html-api-for-script-tags
sirreal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.