@wordpress/html-entities 4.33.1 → 4.34.1-next.2f1c7c01b.0

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
+ ## 4.34.0 (2025-10-29)
6
+
5
7
  ## 4.33.0 (2025-10-17)
6
8
 
7
9
  ## 4.32.0 (2025-10-01)
package/build/index.js CHANGED
@@ -16,12 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/html-entities/src/index.ts
19
21
  var index_exports = {};
20
22
  __export(index_exports, {
21
23
  decodeEntities: () => decodeEntities
22
24
  });
23
25
  module.exports = __toCommonJS(index_exports);
24
- let _decodeTextArea;
26
+ var _decodeTextArea;
25
27
  function decodeEntities(html) {
26
28
  if ("string" !== typeof html || -1 === html.indexOf("&")) {
27
29
  return html;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["let _decodeTextArea: HTMLTextAreaElement | undefined;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param html String that contain HTML entities.\n *\n * @example\n * ```js\n * import { decodeEntities } from '@wordpress/html-entities';\n *\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"\u00E1\"\n * ```\n *\n * @return The decoded string.\n */\nexport function decodeEntities( html: string ): string {\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 decoded;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAI;AAiBG,SAAS,eAAgB,MAAuB;AAEtD,MAAK,aAAa,OAAO,QAAQ,OAAO,KAAK,QAAS,GAAI,GAAI;AAC7D,WAAO;AAAA,EACR;AAGA,MAAK,WAAc,iBAAkB;AACpC,QACC,SAAS,kBACT,SAAS,eAAe,oBACvB;AACD,wBAAkB,SAAS,eACzB,mBAAoB,EAAG,EACvB,cAAe,UAAW;AAAA,IAC7B,OAAO;AACN,wBAAkB,SAAS,cAAe,UAAW;AAAA,IACtD;AAAA,EACD;AAEA,kBAAgB,YAAY;AAC5B,QAAM,UAAU,gBAAgB,eAAe;AAC/C,kBAAgB,YAAY;AAmB5B,SAAO;AACR;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAI;AAiBG,SAAS,eAAgB,MAAuB;AAEtD,MAAK,aAAa,OAAO,QAAQ,OAAO,KAAK,QAAS,GAAI,GAAI;AAC7D,WAAO;AAAA,EACR;AAGA,MAAK,WAAc,iBAAkB;AACpC,QACC,SAAS,kBACT,SAAS,eAAe,oBACvB;AACD,wBAAkB,SAAS,eACzB,mBAAoB,EAAG,EACvB,cAAe,UAAW;AAAA,IAC7B,OAAO;AACN,wBAAkB,SAAS,cAAe,UAAW;AAAA,IACtD;AAAA,EACD;AAEA,kBAAgB,YAAY;AAC5B,QAAM,UAAU,gBAAgB,eAAe;AAC/C,kBAAgB,YAAY;AAmB5B,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,5 @@
1
- let _decodeTextArea;
1
+ // packages/html-entities/src/index.ts
2
+ var _decodeTextArea;
2
3
  function decodeEntities(html) {
3
4
  if ("string" !== typeof html || -1 === html.indexOf("&")) {
4
5
  return html;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["let _decodeTextArea: HTMLTextAreaElement | undefined;\n\n/**\n * Decodes the HTML entities from a given string.\n *\n * @param html String that contain HTML entities.\n *\n * @example\n * ```js\n * import { decodeEntities } from '@wordpress/html-entities';\n *\n * const result = decodeEntities( 'á' );\n * console.log( result ); // result will be \"\u00E1\"\n * ```\n *\n * @return The decoded string.\n */\nexport function decodeEntities( html: string ): string {\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 decoded;\n}\n"],
5
- "mappings": "AAAA,IAAI;AAiBG,SAAS,eAAgB,MAAuB;AAEtD,MAAK,aAAa,OAAO,QAAQ,OAAO,KAAK,QAAS,GAAI,GAAI;AAC7D,WAAO;AAAA,EACR;AAGA,MAAK,WAAc,iBAAkB;AACpC,QACC,SAAS,kBACT,SAAS,eAAe,oBACvB;AACD,wBAAkB,SAAS,eACzB,mBAAoB,EAAG,EACvB,cAAe,UAAW;AAAA,IAC7B,OAAO;AACN,wBAAkB,SAAS,cAAe,UAAW;AAAA,IACtD;AAAA,EACD;AAEA,kBAAgB,YAAY;AAC5B,QAAM,UAAU,gBAAgB,eAAe;AAC/C,kBAAgB,YAAY;AAmB5B,SAAO;AACR;",
5
+ "mappings": ";AAAA,IAAI;AAiBG,SAAS,eAAgB,MAAuB;AAEtD,MAAK,aAAa,OAAO,QAAQ,OAAO,KAAK,QAAS,GAAI,GAAI;AAC7D,WAAO;AAAA,EACR;AAGA,MAAK,WAAc,iBAAkB;AACpC,QACC,SAAS,kBACT,SAAS,eAAe,oBACvB;AACD,wBAAkB,SAAS,eACzB,mBAAoB,EAAG,EACvB,cAAe,UAAW;AAAA,IAC7B,OAAO;AACN,wBAAkB,SAAS,cAAe,UAAW;AAAA,IACtD;AAAA,EACD;AAEA,kBAAgB,YAAY;AAC5B,QAAM,UAAU,gBAAgB,eAAe;AAC/C,kBAAgB,YAAY;AAmB5B,SAAO;AACR;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/html-entities",
3
- "version": "4.33.1",
3
+ "version": "4.34.1-next.2f1c7c01b.0",
4
4
  "description": "HTML entity utilities for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "5f84bafdec1bed05247c1080c12f6a237951b862"
42
+ "gitHead": "c6ddcdf455bc02567a2c9e03de6862a2061b85e8"
43
43
  }