chore: remove old parser

This commit is contained in:
Oliver Eyton-Williams
2021-02-01 19:31:39 +01:00
committed by Mrugesh Mohapatra
parent e3511f2930
commit a3a678b7af
139 changed files with 4 additions and 4 deletions

View File

@ -0,0 +1,20 @@
const is = require('unist-util-is');
// TODO: specific tests for this would be nice, even though it is somewhat
// covered by the plugins that use it.
function splitOnThematicBreak(nodes) {
return nodes.reduce(
(prev, curr) => {
if (is(curr, 'thematicBreak')) {
return [...prev, []];
} else {
const first = prev.slice(0, -1);
const last = prev.slice(-1)[0];
return [...first, [...last, curr]];
}
},
[[]]
);
}
exports.splitOnThematicBreak = splitOnThematicBreak;