MCPcopy Create free account
hub / github.com/TruthHun/BookStack / writeDocument

Function writeDocument

static/word2md/mammoth.browser.js:3804–3821  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

3802 }
3803
3804 function writeDocument(root) {
3805 var builder = xmlbuilder
3806 .create(mapElementName(root.name), {
3807 version: '1.0',
3808 encoding: 'UTF-8',
3809 standalone: true
3810 });
3811
3812 _.forEach(namespaces, function(uri, prefix) {
3813 var key = "xmlns" + (prefix === "" ? "" : ":" + prefix);
3814 builder.attribute(key, uri);
3815 });
3816
3817 root.children.forEach(function(child) {
3818 writeNode(builder, child);
3819 });
3820 return builder.end();
3821 }
3822
3823 return writeDocument(root);
3824}

Callers 1

writeStringFunction · 0.70

Calls 2

mapElementNameFunction · 0.70
writeNodeFunction · 0.70

Tested by

no test coverage detected