Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
visit(markdownAST, node => {
if (!is('thematicBreak', node)) {
return visit.CONTINUE;
}
if (is('thematicBreak', node) && open == false) {
const next = findAfter(markdownAST, node);
if (is('paragraph', next)) {
let firstChild = next.children[0];
if (is('text', firstChild)) {
let { newNode, status, text } = openBlockMaybe(firstChild.value, node);
node = newNode;
open = status;
firstChild.value = text;
} else if (is('strong', firstChild)) {
const textChild = firstChild.children[0];
if (is('text', textChild)) {
visit(node, 'heading', (headingNode: any) => {
title = convertMdastToString(headingNode)
if (title.length > 0) {
return visit.EXIT
} else {
return visit.CONTINUE
}
})
if (title.length > 0) return title