forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update/class-editor-block-description
* master: (45 commits) Parser: Hide the core namespace in serialised data (WordPress#2950) fix: Undefined index warning (WordPress#2982) navigation via keydown PHPCS improvements (WordPress#2914) Update/html block description (WordPress#2917) Framework: Merge EditorSettingsProvider into EditorProvider Framework: Move the store initialization to a dedicated component Rotate header ellipsis to match block ellipsis add/459: Added support for ins, sub and sup Refresh nonce with heartbeat (WordPress#2790) Paste: add table support Bump version to 1.4.0. (WordPress#2954) Blocks: The custom classname should be persisted properly in the block's comment Editor: Fix the scroll position when reordering blocks Polish spacing in block ellipsis menu (WordPress#2955) Editor: HTML Editor per block (WordPress#2797) Show most frequently used blocks next to inserter (WordPress#2877) add/459: Added light grey background to selected inline boundaries Extend inline boundaries to other elements Move markdown fix to own plugin-compatibility file ...
- Loading branch information
Showing
127 changed files
with
2,016 additions
and
839 deletions.
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
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,27 @@ | ||
/** | ||
* Browser dependencies | ||
*/ | ||
const { ELEMENT_NODE } = window.Node; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { isInlineWrapper, isInline, isAllowedBlock, deepFilterNodeList } from './utils'; | ||
import createUnwrapper from './create-unwrapper'; | ||
|
||
export default function( node, doc ) { | ||
if ( node.nodeType !== ELEMENT_NODE ) { | ||
return; | ||
} | ||
|
||
if ( ! isInlineWrapper( node ) ) { | ||
return; | ||
} | ||
|
||
deepFilterNodeList( node.childNodes, [ | ||
createUnwrapper( | ||
( childNode ) => ! isInline( childNode ) && ! isAllowedBlock( node, childNode ), | ||
( childNode ) => childNode.nextElementSibling && doc.createElement( 'BR' ) | ||
), | ||
], doc ); | ||
} |
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,26 @@ | ||
# Paste | ||
|
||
This folder contains all paste specific logic (filters, converters, normalisers...). Each module is tested on their own, and in addition we have some integration tests for frequently used editors. | ||
|
||
## Support table | ||
|
||
| Source | Formatting | Headings | Lists | Image | Separator | Table | | ||
| ---------------- | ---------- | -------- | ----- | ----- | --------- | ----- | | ||
| Google Docs | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Apple Pages | ✓ | ✘ [1] | ✓ | ✘ [1] | n/a | ✓ | | ||
| MS Word | ✓ | ✓ | ✓ | ✘ [2] | n/a | ✓ | | ||
| MS Word Online | ✓ | ✘ [3] | ✓ | ✓ | n/a | ✓ | | ||
| Markdown | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
| Legacy WordPress | ✓ | ✓ | ✓ | … [4] | ✓ | ✓ | | ||
| Web | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ||
|
||
|
||
1. Apple Pages does not pass heading and image information. | ||
2. MS Word only provides a local file path, which cannot be accessed in JavaScript for security reasons. | ||
3. Still to do for MS Word Online. | ||
4. For caption and gallery shortcodes, see #2874. | ||
|
||
## Other notable capabilities | ||
|
||
* Filters out analytics trackers in the form of images. | ||
* Direct image data pasting coming soon. |
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,18 @@ | ||
/** | ||
* Browser dependencies | ||
*/ | ||
const { TEXT_NODE } = window.Node; | ||
|
||
export default function( node ) { | ||
if ( node.nodeType !== TEXT_NODE ) { | ||
return; | ||
} | ||
|
||
const parentNode = node.parentNode; | ||
|
||
if ( [ 'TR', 'TBODY', 'THEAD', 'TFOOT', 'TABLE' ].indexOf( parentNode.nodeName ) === -1 ) { | ||
return; | ||
} | ||
|
||
parentNode.removeChild( 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
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,19 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { equal } from 'assert'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import inlineContentConverter from '../inline-content-converter'; | ||
import { deepFilterHTML } from '../utils'; | ||
|
||
describe( 'inlineContentConverter', () => { | ||
it( 'should remove non-inline content from inline wrapper', () => { | ||
equal( | ||
deepFilterHTML( '<figcaption><p>test</p><p>test</p></figcaption>', [ inlineContentConverter ] ), | ||
'<figcaption>test<br>test</figcaption>' | ||
); | ||
} ); | ||
} ); |
Oops, something went wrong.