Fix getting html from inputs

This commit is contained in:
Eduard Kuzmenko 2022-04-26 00:08:39 +03:00
parent 373fa01b6e
commit 434caf7191
2 changed files with 5 additions and 3 deletions

4
.env
View File

@ -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

View File

@ -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('');
}