* 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)
| 867 | */ |
| 868 | |
| 869 | function 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 | |
| 878 | function join (string1, string2) { |
| 879 | var separator = separatingNewlines(string1, string2); |