Repository navigation
Use a more specific <script> matching - #23407
Merged
Merged
Conversation
…gs which we're interested in. This uses the full `<script>` produced by `WP_Scripts::do_item()` ignoring the Translations and before/after inline scripts, which allows for it to exclude `<script%` tags contained within the before/after html chunks.
Member
|
@Djennez can you confirm it solves the issue? We can include it in the Gutenberg plugin release later today. |
Member
|
@noisysocks, it would be great to include this fix in the plugin release today. |
tellyworth
self-requested a review
June 24, 2020 05:18
tellyworth
approved these changes
Jun 24, 2020
tellyworth
left a comment
Contributor
There was a problem hiding this comment.
This is a smart solution, much quicker than the regex idea. It worked for me in testing.
noisysocks
pushed a commit
that referenced
this pull request
Jun 24, 2020
* Use a more specific matching pattern to only affect the `<script>` tags which we're interested in. This uses the full `<script>` produced by `WP_Scripts::do_item()` ignoring the Translations and before/after inline scripts, which allows for it to exclude `<script%` tags contained within the before/after html chunks. * Rename the variable
This was referenced Jun 24, 2020
Closed
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.
Description
Uses a more specific matching pattern to only affect the
<script>tags which we're interested in.This should resolve the issues in #23158
This uses the full
<script>produced byWP_Scripts::do_item()ignoring the Translations and before/after inline scripts, which allows for it to exclude<script%tags contained within the before/after html chunks.The major change I see here after testing is two fold:
wp-polyfillno longer getdata-handleelements, as they're not built the same way, where they previously were, eg:I'm unsure if this is a concern, as I don't believe scripts should be depending on individual
wp-polyfill-*scripts and only the main polyfill library?How has this been tested?
As in #23158
data-handleattributes on appropriate script tags.post-new.phpcomparing before/after.Types of changes
Bug Fix.
Checklist: