-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Backport WordPress 5.2.1 fixes #15650
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1d09dde
Proxy the code/block-editor replaceBlock action in the core/editor pa…
youknowriad 730d791
Check for selection range count before calling getRangeAt (#15576)
gwwar adcc268
Rich Text: Set applied format as active in applyFormats (#15573)
aduth 705257d
Remove (non-special) comment nodes when pasting content (#15557)
tfrommen 5cc5660
RichText: fix RTL keyboard interactions (#15496)
ellatrix f004741
Temporarily enable tests
ellatrix 9ea31a7
RichText: show boundary only with editable element focus (#15466)
ellatrix 4e45835
Input Interaction: always reset initial vertical position rect (#15624)
ellatrix 72539b8
Block Editor: Restore WritingFlow computeCaretRect target argument
aduth c8dc17d
Testing: Skip test failures for font decoding warnings (#15502)
aduth 09359e3
Tests: Disable randomly failing e2e tests making Travis unreliable (#…
gziolo 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ cache: | |
|
||
branches: | ||
only: | ||
- master | ||
- wp/5.2 | ||
|
||
before_install: | ||
- nvm install | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { remove } from '@wordpress/dom'; | ||
|
||
/** | ||
* Browser dependencies | ||
*/ | ||
const { COMMENT_NODE } = window.Node; | ||
|
||
/** | ||
* Looks for comments, and removes them. | ||
* | ||
* @param {Node} node The node to be processed. | ||
* @return {void} | ||
*/ | ||
export default function( node ) { | ||
if ( node.nodeType === COMMENT_NODE ) { | ||
remove( node ); | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
packages/blocks/src/api/raw-handling/test/comment-remover.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import commentRemover from '../comment-remover'; | ||
import { deepFilterHTML } from '../utils'; | ||
|
||
describe( 'commentRemover', () => { | ||
it( 'should remove a single comment', () => { | ||
expect( deepFilterHTML( | ||
'<!-- Comment -->', | ||
[ commentRemover ] | ||
) ).toEqual( | ||
'' | ||
); | ||
} ); | ||
it( 'should remove multiple comments', () => { | ||
expect( deepFilterHTML( | ||
'<!-- First comment --><p>First paragraph.</p><!-- Second comment --><p>Second paragraph.</p><!-- Third comment -->', | ||
[ commentRemover ] | ||
) ).toEqual( | ||
'<p>First paragraph.</p><p>Second paragraph.</p>' | ||
); | ||
} ); | ||
it( 'should remove nested comments', () => { | ||
expect( deepFilterHTML( | ||
'<p>Paragraph.<!-- Comment --></p>', | ||
[ commentRemover ] | ||
) ).toEqual( | ||
'<p>Paragraph.</p>' | ||
); | ||
} ); | ||
it( 'should remove multi-line comments', () => { | ||
expect( deepFilterHTML( | ||
`<p>First paragraph.</p><!-- | ||
Multi-line | ||
comment | ||
--><p>Second paragraph.</p>`, | ||
[ commentRemover ] | ||
) ).toEqual( | ||
'<p>First paragraph.</p><p>Second paragraph.</p>' | ||
); | ||
} ); | ||
} ); |
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
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
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
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.
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.
I've seen this around locally as well sometimes. Why does this happen?
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.
This is probably related #15626 I'm investigating it.
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.
#15679 should fix it.
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.
No I actually had to add empty lines to the previous npm release (because of the failure we had) to force learna to detect these as changed. This just reverts those unnecessary changes.
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.
Can someone clarify for me: Do these changes matter? Is there anything further which needs to be done in this branch for them?
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.
No, nothing left to do here.