hast-util-heading
hast utility to check if a node is a heading element
Last updated 8 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hast-util-heading 
SYNC missed versions from official npm registry.

hast-util-heading

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if an element is a heading.

Install

npm:

npm install hast-util-heading

Use

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

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

// Given a heading element:
heading({
  type: 'element',
  tagName: 'h1',
  children: [{type: 'text', value: 'Delta'}]
}) // => true

API

heading(node)

Check if the given value is a heading element.

Security

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

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.

License

MIT © Titus Wormer

Current Tags

  • 1.0.4                                ...           latest (8 months ago)

5 Versions

  • 1.0.4                                ...           8 months ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)

Copyright 2014 - 2016 © taobao.org |