PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.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 All 404 releases
gutenberg / build / scripts / html-entities / index.js

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

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