@wordpress/html-entities 3.50.0 → 3.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 3.51.0 (2024-02-09)
6
+
5
7
  ## 3.50.0 (2024-01-24)
6
8
 
7
9
  ## 3.49.0 (2024-01-10)
package/build/index.js CHANGED
@@ -55,7 +55,6 @@ function decodeEntities(html) {
55
55
  *
56
56
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
57
57
  */
58
- return (/** @type {string} */decoded
59
- );
58
+ return /** @type {string} */decoded;
60
59
  }
61
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_decodeTextArea","decodeEntities","html","indexOf","undefined","document","implementation","createHTMLDocument","createElement","innerHTML","decoded","textContent"],"sources":["@wordpress/html-entities/src/index.js"],"sourcesContent":["/** @type {HTMLTextAreaElement} */\nlet _decodeTextArea;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param {string} html String that contain HTML entities.\n *\n * @example\n * ```js\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"á\"\n * ```\n *\n * @return {string} The decoded string.\n */\nexport function decodeEntities( html ) {\n\t// Not a string, or no entities to decode.\n\tif ( 'string' !== typeof html || -1 === html.indexOf( '&' ) ) {\n\t\treturn html;\n\t}\n\n\t// Create a textarea for decoding entities, that we can reuse.\n\tif ( undefined === _decodeTextArea ) {\n\t\tif (\n\t\t\tdocument.implementation &&\n\t\t\tdocument.implementation.createHTMLDocument\n\t\t) {\n\t\t\t_decodeTextArea = document.implementation\n\t\t\t\t.createHTMLDocument( '' )\n\t\t\t\t.createElement( 'textarea' );\n\t\t} else {\n\t\t\t_decodeTextArea = document.createElement( 'textarea' );\n\t\t}\n\t}\n\n\t_decodeTextArea.innerHTML = html;\n\tconst decoded = _decodeTextArea.textContent;\n\t_decodeTextArea.innerHTML = '';\n\n\t/**\n\t * Cast to string, HTMLTextAreaElement should always have `string` textContent.\n\t *\n\t * > The `textContent` property of the `Node` interface represents the text content of the\n\t * > node and its descendants.\n\t * >\n\t * > Value: A string or `null`\n\t * >\n\t * > * If the node is a `document` or a Doctype, `textContent` returns `null`.\n\t * > * If the node is a CDATA section, comment, processing instruction, or text node,\n\t * > textContent returns the text inside the node, i.e., the `Node.nodeValue`.\n\t * > * For other node types, `textContent returns the concatenation of the textContent of\n\t * > every child node, excluding comments and processing instructions. (This is an empty\n\t * > string if the node has no children.)\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent\n\t */\n\treturn /** @type {string} */ ( decoded );\n}\n"],"mappings":";;;;;;AAAA;AACA,IAAIA,eAAe;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,IAAI,EAAG;EACtC;EACA,IAAK,QAAQ,KAAK,OAAOA,IAAI,IAAI,CAAC,CAAC,KAAKA,IAAI,CAACC,OAAO,CAAE,GAAI,CAAC,EAAG;IAC7D,OAAOD,IAAI;EACZ;;EAEA;EACA,IAAKE,SAAS,KAAKJ,eAAe,EAAG;IACpC,IACCK,QAAQ,CAACC,cAAc,IACvBD,QAAQ,CAACC,cAAc,CAACC,kBAAkB,EACzC;MACDP,eAAe,GAAGK,QAAQ,CAACC,cAAc,CACvCC,kBAAkB,CAAE,EAAG,CAAC,CACxBC,aAAa,CAAE,UAAW,CAAC;IAC9B,CAAC,MAAM;MACNR,eAAe,GAAGK,QAAQ,CAACG,aAAa,CAAE,UAAW,CAAC;IACvD;EACD;EAEAR,eAAe,CAACS,SAAS,GAAGP,IAAI;EAChC,MAAMQ,OAAO,GAAGV,eAAe,CAACW,WAAW;EAC3CX,eAAe,CAACS,SAAS,GAAG,EAAE;;EAE9B;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,OAAO,sBAAwBC;EAAO;AACvC"}
1
+ {"version":3,"names":["_decodeTextArea","decodeEntities","html","indexOf","undefined","document","implementation","createHTMLDocument","createElement","innerHTML","decoded","textContent"],"sources":["@wordpress/html-entities/src/index.js"],"sourcesContent":["/** @type {HTMLTextAreaElement} */\nlet _decodeTextArea;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param {string} html String that contain HTML entities.\n *\n * @example\n * ```js\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"á\"\n * ```\n *\n * @return {string} The decoded string.\n */\nexport function decodeEntities( html ) {\n\t// Not a string, or no entities to decode.\n\tif ( 'string' !== typeof html || -1 === html.indexOf( '&' ) ) {\n\t\treturn html;\n\t}\n\n\t// Create a textarea for decoding entities, that we can reuse.\n\tif ( undefined === _decodeTextArea ) {\n\t\tif (\n\t\t\tdocument.implementation &&\n\t\t\tdocument.implementation.createHTMLDocument\n\t\t) {\n\t\t\t_decodeTextArea = document.implementation\n\t\t\t\t.createHTMLDocument( '' )\n\t\t\t\t.createElement( 'textarea' );\n\t\t} else {\n\t\t\t_decodeTextArea = document.createElement( 'textarea' );\n\t\t}\n\t}\n\n\t_decodeTextArea.innerHTML = html;\n\tconst decoded = _decodeTextArea.textContent;\n\t_decodeTextArea.innerHTML = '';\n\n\t/**\n\t * Cast to string, HTMLTextAreaElement should always have `string` textContent.\n\t *\n\t * > The `textContent` property of the `Node` interface represents the text content of the\n\t * > node and its descendants.\n\t * >\n\t * > Value: A string or `null`\n\t * >\n\t * > * If the node is a `document` or a Doctype, `textContent` returns `null`.\n\t * > * If the node is a CDATA section, comment, processing instruction, or text node,\n\t * > textContent returns the text inside the node, i.e., the `Node.nodeValue`.\n\t * > * For other node types, `textContent returns the concatenation of the textContent of\n\t * > every child node, excluding comments and processing instructions. (This is an empty\n\t * > string if the node has no children.)\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent\n\t */\n\treturn /** @type {string} */ ( decoded );\n}\n"],"mappings":";;;;;;AAAA;AACA,IAAIA,eAAe;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAEC,IAAI,EAAG;EACtC;EACA,IAAK,QAAQ,KAAK,OAAOA,IAAI,IAAI,CAAC,CAAC,KAAKA,IAAI,CAACC,OAAO,CAAE,GAAI,CAAC,EAAG;IAC7D,OAAOD,IAAI;EACZ;;EAEA;EACA,IAAKE,SAAS,KAAKJ,eAAe,EAAG;IACpC,IACCK,QAAQ,CAACC,cAAc,IACvBD,QAAQ,CAACC,cAAc,CAACC,kBAAkB,EACzC;MACDP,eAAe,GAAGK,QAAQ,CAACC,cAAc,CACvCC,kBAAkB,CAAE,EAAG,CAAC,CACxBC,aAAa,CAAE,UAAW,CAAC;IAC9B,CAAC,MAAM;MACNR,eAAe,GAAGK,QAAQ,CAACG,aAAa,CAAE,UAAW,CAAC;IACvD;EACD;EAEAR,eAAe,CAACS,SAAS,GAAGP,IAAI;EAChC,MAAMQ,OAAO,GAAGV,eAAe,CAACW,WAAW;EAC3CX,eAAe,CAACS,SAAS,GAAG,EAAE;;EAE9B;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,OAAO,qBAAwBC,OAAO;AACvC"}
@@ -49,7 +49,6 @@ export function decodeEntities(html) {
49
49
  *
50
50
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
51
51
  */
52
- return (/** @type {string} */decoded
53
- );
52
+ return /** @type {string} */decoded;
54
53
  }
55
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_decodeTextArea","decodeEntities","html","indexOf","undefined","document","implementation","createHTMLDocument","createElement","innerHTML","decoded","textContent"],"sources":["@wordpress/html-entities/src/index.js"],"sourcesContent":["/** @type {HTMLTextAreaElement} */\nlet _decodeTextArea;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param {string} html String that contain HTML entities.\n *\n * @example\n * ```js\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"á\"\n * ```\n *\n * @return {string} The decoded string.\n */\nexport function decodeEntities( html ) {\n\t// Not a string, or no entities to decode.\n\tif ( 'string' !== typeof html || -1 === html.indexOf( '&' ) ) {\n\t\treturn html;\n\t}\n\n\t// Create a textarea for decoding entities, that we can reuse.\n\tif ( undefined === _decodeTextArea ) {\n\t\tif (\n\t\t\tdocument.implementation &&\n\t\t\tdocument.implementation.createHTMLDocument\n\t\t) {\n\t\t\t_decodeTextArea = document.implementation\n\t\t\t\t.createHTMLDocument( '' )\n\t\t\t\t.createElement( 'textarea' );\n\t\t} else {\n\t\t\t_decodeTextArea = document.createElement( 'textarea' );\n\t\t}\n\t}\n\n\t_decodeTextArea.innerHTML = html;\n\tconst decoded = _decodeTextArea.textContent;\n\t_decodeTextArea.innerHTML = '';\n\n\t/**\n\t * Cast to string, HTMLTextAreaElement should always have `string` textContent.\n\t *\n\t * > The `textContent` property of the `Node` interface represents the text content of the\n\t * > node and its descendants.\n\t * >\n\t * > Value: A string or `null`\n\t * >\n\t * > * If the node is a `document` or a Doctype, `textContent` returns `null`.\n\t * > * If the node is a CDATA section, comment, processing instruction, or text node,\n\t * > textContent returns the text inside the node, i.e., the `Node.nodeValue`.\n\t * > * For other node types, `textContent returns the concatenation of the textContent of\n\t * > every child node, excluding comments and processing instructions. (This is an empty\n\t * > string if the node has no children.)\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent\n\t */\n\treturn /** @type {string} */ ( decoded );\n}\n"],"mappings":"AAAA;AACA,IAAIA,eAAe;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEC,IAAI,EAAG;EACtC;EACA,IAAK,QAAQ,KAAK,OAAOA,IAAI,IAAI,CAAC,CAAC,KAAKA,IAAI,CAACC,OAAO,CAAE,GAAI,CAAC,EAAG;IAC7D,OAAOD,IAAI;EACZ;;EAEA;EACA,IAAKE,SAAS,KAAKJ,eAAe,EAAG;IACpC,IACCK,QAAQ,CAACC,cAAc,IACvBD,QAAQ,CAACC,cAAc,CAACC,kBAAkB,EACzC;MACDP,eAAe,GAAGK,QAAQ,CAACC,cAAc,CACvCC,kBAAkB,CAAE,EAAG,CAAC,CACxBC,aAAa,CAAE,UAAW,CAAC;IAC9B,CAAC,MAAM;MACNR,eAAe,GAAGK,QAAQ,CAACG,aAAa,CAAE,UAAW,CAAC;IACvD;EACD;EAEAR,eAAe,CAACS,SAAS,GAAGP,IAAI;EAChC,MAAMQ,OAAO,GAAGV,eAAe,CAACW,WAAW;EAC3CX,eAAe,CAACS,SAAS,GAAG,EAAE;;EAE9B;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,OAAO,sBAAwBC;EAAO;AACvC"}
1
+ {"version":3,"names":["_decodeTextArea","decodeEntities","html","indexOf","undefined","document","implementation","createHTMLDocument","createElement","innerHTML","decoded","textContent"],"sources":["@wordpress/html-entities/src/index.js"],"sourcesContent":["/** @type {HTMLTextAreaElement} */\nlet _decodeTextArea;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param {string} html String that contain HTML entities.\n *\n * @example\n * ```js\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"á\"\n * ```\n *\n * @return {string} The decoded string.\n */\nexport function decodeEntities( html ) {\n\t// Not a string, or no entities to decode.\n\tif ( 'string' !== typeof html || -1 === html.indexOf( '&' ) ) {\n\t\treturn html;\n\t}\n\n\t// Create a textarea for decoding entities, that we can reuse.\n\tif ( undefined === _decodeTextArea ) {\n\t\tif (\n\t\t\tdocument.implementation &&\n\t\t\tdocument.implementation.createHTMLDocument\n\t\t) {\n\t\t\t_decodeTextArea = document.implementation\n\t\t\t\t.createHTMLDocument( '' )\n\t\t\t\t.createElement( 'textarea' );\n\t\t} else {\n\t\t\t_decodeTextArea = document.createElement( 'textarea' );\n\t\t}\n\t}\n\n\t_decodeTextArea.innerHTML = html;\n\tconst decoded = _decodeTextArea.textContent;\n\t_decodeTextArea.innerHTML = '';\n\n\t/**\n\t * Cast to string, HTMLTextAreaElement should always have `string` textContent.\n\t *\n\t * > The `textContent` property of the `Node` interface represents the text content of the\n\t * > node and its descendants.\n\t * >\n\t * > Value: A string or `null`\n\t * >\n\t * > * If the node is a `document` or a Doctype, `textContent` returns `null`.\n\t * > * If the node is a CDATA section, comment, processing instruction, or text node,\n\t * > textContent returns the text inside the node, i.e., the `Node.nodeValue`.\n\t * > * For other node types, `textContent returns the concatenation of the textContent of\n\t * > every child node, excluding comments and processing instructions. (This is an empty\n\t * > string if the node has no children.)\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent\n\t */\n\treturn /** @type {string} */ ( decoded );\n}\n"],"mappings":"AAAA;AACA,IAAIA,eAAe;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAEC,IAAI,EAAG;EACtC;EACA,IAAK,QAAQ,KAAK,OAAOA,IAAI,IAAI,CAAC,CAAC,KAAKA,IAAI,CAACC,OAAO,CAAE,GAAI,CAAC,EAAG;IAC7D,OAAOD,IAAI;EACZ;;EAEA;EACA,IAAKE,SAAS,KAAKJ,eAAe,EAAG;IACpC,IACCK,QAAQ,CAACC,cAAc,IACvBD,QAAQ,CAACC,cAAc,CAACC,kBAAkB,EACzC;MACDP,eAAe,GAAGK,QAAQ,CAACC,cAAc,CACvCC,kBAAkB,CAAE,EAAG,CAAC,CACxBC,aAAa,CAAE,UAAW,CAAC;IAC9B,CAAC,MAAM;MACNR,eAAe,GAAGK,QAAQ,CAACG,aAAa,CAAE,UAAW,CAAC;IACvD;EACD;EAEAR,eAAe,CAACS,SAAS,GAAGP,IAAI;EAChC,MAAMQ,OAAO,GAAGV,eAAe,CAACW,WAAW;EAC3CX,eAAe,CAACS,SAAS,GAAG,EAAE;;EAE9B;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,OAAO,qBAAwBC,OAAO;AACvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/html-entities",
3
- "version": "3.50.0",
3
+ "version": "3.51.1",
4
4
  "description": "HTML entity utilities for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "45de2cb4212fed7f2763e95f10300d1ff9d0ec08"
35
+ "gitHead": "730beb7fd33d3382d6032c3f33e451625a0fcf36"
36
36
  }