Wondering what’s next for npm?Check out our public roadmap! »

hast-util-sectioning

1.0.5 • Public • Published

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.

Related

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

Install

npm i hast-util-sectioning

DownloadsWeekly Downloads

8

Version

1.0.5

License

MIT

Unpacked Size

8.29 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar