diff --git a/package-lock.json b/package-lock.json index 70ca02897fb2f..5b7aecbd715ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2415,6 +2415,7 @@ "version": "file:packages/rich-text", "requires": { "@babel/runtime": "^7.0.0", + "@wordpress/escape-html": "file:packages/escape-html", "lodash": "^4.17.10" } }, diff --git a/packages/rich-text/src/apply-format.js b/packages/rich-text/src/apply-format.js index 75212c001adc9..6d7104c874cfb 100644 --- a/packages/rich-text/src/apply-format.js +++ b/packages/rich-text/src/apply-format.js @@ -9,12 +9,12 @@ import { normaliseFormats } from './normalise-formats'; * given `endIndex`. Indices are retrieved from the selection if none are * provided. * - * @param {Object} record Record to modify. + * @param {Object} value Value to modify. * @param {Object} format Format to apply. * @param {number} startIndex Start index. * @param {number} endIndex End index. * - * @return {Object} A new record with the format applied. + * @return {Object} A new value with the format applied. */ export function applyFormat( { formats, text, start, end }, diff --git a/test/e2e/test-plugins/deprecated-node-matcher/index.js b/test/e2e/test-plugins/deprecated-node-matcher/index.js index b01a86f5c2121..5f41ed3325afd 100644 --- a/test/e2e/test-plugins/deprecated-node-matcher/index.js +++ b/test/e2e/test-plugins/deprecated-node-matcher/index.js @@ -32,13 +32,13 @@ }, } ); - function torichText( value ) { + function toRichTextValue( value ) { return _.map( value, function( subValue ) { return subValue.children; } ); } - function fromrichText( value ) { + function fromRichTextValue( value ) { return _.map( value, function( subValue ) { return { children: subValue, @@ -65,10 +65,10 @@ return el( 'blockquote', {}, el( RichText, { multiline: 'p', - value: torichText( attributes.value ), + value: toRichTextValue( attributes.value ), onChange: function( nextValue ) { setAttributes( { - value: fromrichText( nextValue ), + value: fromRichTextValue( nextValue ), } ); }, } ) @@ -77,7 +77,7 @@ save: function( { attributes } ) { return el( 'blockquote', {}, el( RichText.Content, { - value: torichText( attributes.value ), + value: toRichTextValue( attributes.value ), } ) ); },