Eduard Kuzmenko
3 years ago
3 changed files with 10 additions and 5 deletions
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
export default function documentFragmentToHTML(fragment: DocumentFragment) { |
||||
return Array.from(fragment.childNodes).map((node) => { |
||||
return node.nodeType === 3 ? node.textContent : (node as Element).outerHTML + '\n'; |
||||
return node.nodeType === 3 ? node.textContent : (node as Element).outerHTML; |
||||
}).join(''); |
||||
} |
||||
|
Loading…
Reference in new issue