plugin updates
This commit is contained in:
34
wp/wp-includes/js/dist/escape-html.js
vendored
34
wp/wp-includes/js/dist/escape-html.js
vendored
@@ -57,9 +57,9 @@ __webpack_require__.d(__webpack_exports__, {
|
||||
*
|
||||
* See: https://core.trac.wordpress.org/ticket/45387
|
||||
*
|
||||
* @param {string} value Original string.
|
||||
* @param value Original string.
|
||||
*
|
||||
* @return {string} Escaped string.
|
||||
* @return Escaped string.
|
||||
*/
|
||||
function __unstableEscapeGreaterThan(value) {
|
||||
return value.replace(/>/g, '>');
|
||||
@@ -79,8 +79,6 @@ function __unstableEscapeGreaterThan(value) {
|
||||
* and noncharacters."
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
||||
*
|
||||
* @type {RegExp}
|
||||
*/
|
||||
const REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
||||
|
||||
@@ -94,9 +92,9 @@ const REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
|
||||
* @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand
|
||||
* @see https://w3c.github.io/html/syntax.html#named-character-references
|
||||
*
|
||||
* @param {string} value Original string.
|
||||
* @param value Original string.
|
||||
*
|
||||
* @return {string} Escaped string.
|
||||
* @return Escaped string.
|
||||
*/
|
||||
function escapeAmpersand(value) {
|
||||
return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&');
|
||||
@@ -105,9 +103,9 @@ function escapeAmpersand(value) {
|
||||
/**
|
||||
* Returns a string with quotation marks replaced.
|
||||
*
|
||||
* @param {string} value Original string.
|
||||
* @param value Original string.
|
||||
*
|
||||
* @return {string} Escaped string.
|
||||
* @return Escaped string.
|
||||
*/
|
||||
function escapeQuotationMark(value) {
|
||||
return value.replace(/"/g, '"');
|
||||
@@ -116,9 +114,9 @@ function escapeQuotationMark(value) {
|
||||
/**
|
||||
* Returns a string with less-than sign replaced.
|
||||
*
|
||||
* @param {string} value Original string.
|
||||
* @param value Original string.
|
||||
*
|
||||
* @return {string} Escaped string.
|
||||
* @return Escaped string.
|
||||
*/
|
||||
function escapeLessThan(value) {
|
||||
return value.replace(/</g, '<');
|
||||
@@ -140,9 +138,9 @@ function escapeLessThan(value) {
|
||||
*
|
||||
* See: https://core.trac.wordpress.org/ticket/45387
|
||||
*
|
||||
* @param {string} value Attribute value.
|
||||
* @param value Attribute value.
|
||||
*
|
||||
* @return {string} Escaped attribute value.
|
||||
* @return Escaped attribute value.
|
||||
*/
|
||||
function escapeAttribute(value) {
|
||||
return __unstableEscapeGreaterThan(escapeQuotationMark(escapeAmpersand(value)));
|
||||
@@ -156,9 +154,9 @@ function escapeAttribute(value) {
|
||||
* "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
|
||||
* ambiguous ampersand."
|
||||
*
|
||||
* @param {string} value Element value.
|
||||
* @param value Element value.
|
||||
*
|
||||
* @return {string} Escaped HTML element value.
|
||||
* @return Escaped HTML element value.
|
||||
*/
|
||||
function escapeHTML(value) {
|
||||
return escapeLessThan(escapeAmpersand(value));
|
||||
@@ -169,9 +167,9 @@ function escapeHTML(value) {
|
||||
* `escapeHTML`, because for editable HTML, ALL ampersands must be escaped in
|
||||
* order to render the content correctly on the page.
|
||||
*
|
||||
* @param {string} value Element value.
|
||||
* @param value Element value.
|
||||
*
|
||||
* @return {string} Escaped HTML element value.
|
||||
* @return Escaped HTML element value.
|
||||
*/
|
||||
function escapeEditableHTML(value) {
|
||||
return escapeLessThan(value.replace(/&/g, '&'));
|
||||
@@ -180,9 +178,9 @@ function escapeEditableHTML(value) {
|
||||
/**
|
||||
* Returns true if the given attribute name is valid, or false otherwise.
|
||||
*
|
||||
* @param {string} name Attribute name to test.
|
||||
* @param name Attribute name to test.
|
||||
*
|
||||
* @return {boolean} Whether attribute is valid.
|
||||
* @return Whether attribute is valid.
|
||||
*/
|
||||
function isValidAttributeName(name) {
|
||||
return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
|
||||
|
||||
Reference in New Issue
Block a user