-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Merge conflicting wp.editor
objects into a single, non-conflicting module
#33228
Merged
+29
−3
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
01daa00
Export members of legacy window.wp.editor from the new window.wp.edit…
adamziel b644a7d
Add an explanatory comment
adamziel d880b51
Use optional chaining for editor/index.js exports
adamziel 8d4a984
Default to an empty object on export from oldEditor
adamziel ae66155
Use an inline script instead of modifying the @wordpress/editor package
adamziel ed8f3a8
Lint
adamziel f4601f7
Move the inline script to gutenberg_override_script
adamziel 723a9c8
Remove gutenberg_enqueue_wp_old_editor_compatibility_snippet
adamziel 59db57c
Formatting
adamziel ae4b7ac
Adjust wp-editor-meta-box E2E test
adamziel 48c1929
Only add inline script if the handle is wp-editor
adamziel 7277ce9
Add explanatory comment for the e2e test
adamziel c714c89
Add even more context to that comment
adamziel 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
There are no files selected for viewing
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change expected, I feel this test has been updated back and forth several times already in the last couple releases, do we understand why this change is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that TinyMCE's WordPress plugin does the following:
https://github.com/WordPress/wordpress-develop/blob/2382765afa36e10bf3c74420024ad4e85763a47c/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js#L15
https://github.com/WordPress/wordpress-develop/blob/2382765afa36e10bf3c74420024ad4e85763a47c/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js#L132-L133
https://github.com/WordPress/wordpress-develop/blob/2382765afa36e10bf3c74420024ad4e85763a47c/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js#L593-L609
So:
Object.assign( window.wp.editor, window.wp.oldEditor );
is in place, then hasWpauto is set to true by editor.getParam( 'wpautop', true ); .<p>
<p>
tags.<p>
but TinyMCE wraps it anyway.<p>
tags are not automatically removed at that stage.Now, for the purposes of this test, we explicitly set wpautop to true in the test plugin here:
gutenberg/packages/e2e-tests/plugins/wp-editor-metabox.php
Line 36 in 3da717b
This means that we do not want to see the the
<p>
tags in the editor. I added some documentation to that test to explain how to proceed in case it flips back again at some point @youknowriad .There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one @adamziel, this test should be finally reliable 👍🏻