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

Function process

static/word2md/turndown.js:805–819  ·  view source on GitHub ↗

* Reduces a DOM node down to its Markdown string equivalent * @private * @param {HTMLElement} parentNode The node to convert * @returns A Markdown representation of the node * @type String

(parentNode)

Source from the content-addressed store, hash-verified

803 */
804
805function process (parentNode) {
806 var self = this;
807 return reduce.call(parentNode.childNodes, function (output, node) {
808 node = new Node(node);
809
810 var replacement = '';
811 if (node.nodeType === 3) {
812 replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue);
813 } else if (node.nodeType === 1) {
814 replacement = replacementForNode.call(self, node);
815 }
816
817 return join(output, replacement)
818 }, '')
819}
820
821/**
822 * Appends strings as each rule requires and trims the output

Callers 1

processItemsFunction · 0.85

Calls 1

joinFunction · 0.85

Tested by

no test coverage detected