wp/wp-includes/js/dist/html-entities.js
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    80 /******/ 	// __webpack_public_path__
    80 /******/ 	// __webpack_public_path__
    81 /******/ 	__webpack_require__.p = "";
    81 /******/ 	__webpack_require__.p = "";
    82 /******/
    82 /******/
    83 /******/
    83 /******/
    84 /******/ 	// Load entry module and return exports
    84 /******/ 	// Load entry module and return exports
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 342);
    85 /******/ 	return __webpack_require__(__webpack_require__.s = 422);
    86 /******/ })
    86 /******/ })
    87 /************************************************************************/
    87 /************************************************************************/
    88 /******/ ({
    88 /******/ ({
    89 
    89 
    90 /***/ 342:
    90 /***/ 422:
    91 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    91 /***/ (function(module, __webpack_exports__, __webpack_require__) {
    92 
    92 
    93 "use strict";
    93 "use strict";
    94 __webpack_require__.r(__webpack_exports__);
    94 __webpack_require__.r(__webpack_exports__);
    95 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
    95 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
       
    96 /** @type {HTMLTextAreaElement} */
    96 var _decodeTextArea;
    97 var _decodeTextArea;
    97 /**
    98 /**
    98  * Decodes the HTML entities from a given string.
    99  * Decodes the HTML entities from a given string.
    99  *
   100  *
   100  * @param {string} html String that contain HTML entities.
   101  * @param {string} html String that contain HTML entities.
   125   }
   126   }
   126 
   127 
   127   _decodeTextArea.innerHTML = html;
   128   _decodeTextArea.innerHTML = html;
   128   var decoded = _decodeTextArea.textContent;
   129   var decoded = _decodeTextArea.textContent;
   129   _decodeTextArea.innerHTML = '';
   130   _decodeTextArea.innerHTML = '';
   130   return decoded;
   131   /**
       
   132    * Cast to string, HTMLTextAreaElement should always have `string` textContent.
       
   133    *
       
   134    * > The `textContent` property of the `Node` interface represents the text content of the
       
   135    * > node and its descendants.
       
   136    * >
       
   137    * > Value: A string or `null`
       
   138    * >
       
   139    * > * If the node is a `document` or a Doctype, `textContent` returns `null`.
       
   140    * > * If the node is a CDATA section, comment, processing instruction, or text node,
       
   141    * >   textContent returns the text inside the node, i.e., the `Node.nodeValue`.
       
   142    * > * For other node types, `textContent returns the concatenation of the textContent of
       
   143    * >   every child node, excluding comments and processing instructions. (This is an empty
       
   144    * >   string if the node has no children.)
       
   145    *
       
   146    * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent
       
   147    */
       
   148 
       
   149   return (
       
   150     /** @type {string} */
       
   151     decoded
       
   152   );
   131 }
   153 }
   132 
   154 
   133 
   155 
   134 /***/ })
   156 /***/ })
   135 
   157