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

Function separatingNewlines

static/word2md/turndown.js:869–876  ·  view source on GitHub ↗

* Determines the new lines between the current output and the replacement * @private * @param {String} output The current conversion output * @param {String} replacement The string to append to the output * @returns The whitespace to separate the current output and the replacement * @type Strin

(output, replacement)

Source from the content-addressed store, hash-verified

867 */
868
869function separatingNewlines (output, replacement) {
870 var newlines = [
871 output.match(trailingNewLinesRegExp)[0],
872 replacement.match(leadingNewLinesRegExp)[0]
873 ].sort();
874 var maxNewlines = newlines[newlines.length - 1];
875 return maxNewlines.length < 2 ? maxNewlines : '\n\n'
876}
877
878function join (string1, string2) {
879 var separator = separatingNewlines(string1, string2);

Callers 1

joinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected