How to use the unist-util-visit.CONTINUE function in unist-util-visit

To help you get started, we’ve selected a few unist-util-visit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openregister / specification / plugins / gatsby-remark-hiblocks / index.js View on Github external
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)) {
github BoostIO / BoostNote.next / src / lib / markdown.ts View on Github external
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

unist-util-visit

unist utility to visit nodes

MIT
Latest version published 10 months ago

Package Health Score

83 / 100
Full package analysis