unified

Project: syntax-tree/hast-util-sectioning

Package: hast-util-sectioning@1.0.4

  1. Dependencies: 1·Dependents: 0
  2. hast utility to check if a node is a sectioning element
  1. util 118
  2. utility 114
  3. unist 110
  4. html 110
  5. hast 60
  6. hast-util 40
  7. category 7

hast-util-sectioning

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if an element is sectioning.

Install

npm:

npm install hast-util-sectioning

Use

var sectioning = require('hast-util-sectioning')

sectioning({
  type: 'element',
  tagName: 'a',
  properties: {href: '#alpha', title: 'Bravo'},
  children: [{type: 'text', value: 'Charlie'}]
}) // => false

sectioning({
  type: 'element',
  tagName: 'article',
  children: [
    {
      type: 'element',
      tagName: 'p',
      children: [{type: 'text', value: 'Delta'}]
    }
  ]
}) // => true

API

sectioning(node)

Check if the given value is a sectioning element.

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

Security

hast-util-sectioning does not change the syntax tree so there are no openings for cross-site scripting (XSS) attacks.

License

MIT © Titus Wormer