How to use hast-util-is-element - 1 common examples

To help you get started, we’ve selected a few hast-util-is-element 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 umijs / father-doc / packages / umi-plugin-father-doc / src / transformer / remark / header.ts View on Github external
visit(ast, 'element', node => {
      if (is(node, headings) && has(node, 'id')) {
        vFile.data.slugs.push({
          depth: parseInt(node.tagName[1], 10) - 1,
          value: toString(node),
          heading: (node.properties as any)?.id,
        });
      }
    });
  } else {

hast-util-is-element

hast utility to check if a node is a (certain) element

MIT
Latest version published 1 year ago

Package Health Score

71 / 100
Full package analysis

Popular hast-util-is-element functions