How to use the unist-util-visit.EXIT 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 kjirou / unlimited-blog-works / src / page-generator.ts View on Github external
unistUtilVisit(node, (n: any) => {
    if (n.type === 'image') {
      if (n.url) {
        found = n.url;
        return unistUtilVisit.EXIT;
      }
    }
  });
  return found;
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
github remarkjs / remark-lint / packages / remark-lint-first-heading-level / index.js View on Github external
function visitor(node) {
    var depth

    if (!generated(node)) {
      if (node.type === 'heading') {
        depth = node.depth
      } else if (node.type === 'html') {
        depth = infer(node)
      }

      if (depth !== undefined) {
        if (depth !== style) {
          file.message('First heading level should be `' + style + '`', node)
        }

        return visit.EXIT
      }
    }
  }
}
github syntax-tree / hast-util-to-mdast / lib / handlers / media.js View on Github external
function findLink() {
    linkInFallbackContent = true
    return visit.EXIT
  }
}

unist-util-visit

unist utility to visit nodes

MIT
Latest version published 1 year ago

Package Health Score

77 / 100
Full package analysis