Browse Source

Fix getting html from inputs

master
Eduard Kuzmenko 3 years ago
parent
commit
434caf7191
  1. 4
      .env
  2. 4
      src/helpers/dom/documentFragmentToHTML.ts

4
.env

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
API_ID=1025907
API_HASH=452b0359b988148995f22ff0f4229750
VERSION=1.4.3
VERSION_FULL=1.4.3 (172)
BUILD=172
VERSION_FULL=1.4.3 (173)
BUILD=173

4
src/helpers/dom/documentFragmentToHTML.ts

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
import encodeEntities from "../string/encodeEntities";
export default function documentFragmentToHTML(fragment: DocumentFragment) {
return Array.from(fragment.childNodes).map((node) => {
return node.nodeType === 3 ? node.textContent : (node as Element).outerHTML;
return node.nodeType === 3 ? encodeEntities(node.textContent) : (node as Element).outerHTML;
}).join('');
}

Loading…
Cancel
Save