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

Function replacementForNode

static/word2md/turndown.js:848–858  ·  view source on GitHub ↗

* Converts an element node to its Markdown equivalent * @private * @param {HTMLElement} node The node to convert * @returns A Markdown representation of the node * @type String

(node)

Source from the content-addressed store, hash-verified

846 */
847
848function replacementForNode (node) {
849 var rule = this.rules.forNode(node);
850 var content = process.call(this, node);
851 var whitespace = node.flankingWhitespace;
852 if (whitespace.leading || whitespace.trailing) content = content.trim();
853 return (
854 whitespace.leading +
855 rule.replacement(content, node, this.options) +
856 whitespace.trailing
857 )
858}
859
860/**
861 * Determines the new lines between the current output and the replacement

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected