PluginProbe
Gutenberg / 22.9.0
Gutenberg v22.9.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / scripts / html-entities / index.js

index.js in Gutenberg 22.9.0, at build/scripts/html-entities/index.js

47 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 var wp;
3 (wp ||= {}).htmlEntities = (() => {
4 var __defProp = Object.defineProperty;
5 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6 var __getOwnPropNames = Object.getOwnPropertyNames;
7 var __hasOwnProp = Object.prototype.hasOwnProperty;
8 var __export = (target, all) => {
9 for (var name in all)
10 __defProp(target, name, { get: all[name], enumerable: true });
11 };
12 var __copyProps = (to, from, except, desc) => {
13 if (from && typeof from === "object" || typeof from === "function") {
14 for (let key of __getOwnPropNames(from))
15 if (!__hasOwnProp.call(to, key) && key !== except)
16 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17 }
18 return to;
19 };
20 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
22 // packages/html-entities/build-module/index.mjs
23 var index_exports = {};
24 __export(index_exports, {
25 decodeEntities: () => decodeEntities
26 });
27 var _decodeTextArea;
28 function decodeEntities(html) {
29 if ("string" !== typeof html || -1 === html.indexOf("&")) {
30 return html;
31 }
32 if (void 0 === _decodeTextArea) {
33 if (document.implementation && document.implementation.createHTMLDocument) {
34 _decodeTextArea = document.implementation.createHTMLDocument("").createElement("textarea");
35 } else {
36 _decodeTextArea = document.createElement("textarea");
37 }
38 }
39 _decodeTextArea.innerHTML = html;
40 const decoded = _decodeTextArea.textContent ?? "";
41 _decodeTextArea.innerHTML = "";
42 return decoded;
43 }
44 return __toCommonJS(index_exports);
45 })();
46 //# sourceMappingURL=index.js.map
47