Notoriously Punctual Manatee
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

hast-util-interactive

1.0.5 • Public • Published

hast-util-interactive

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check whether a node is interactive.

Install

npm:

npm install hast-util-interactive

Use

var interactive = require('hast-util-interactive')
 
interactive({
  type: 'element',
  tagName: 'a',
  properties: {},
  children: []
}) // => false
 
interactive({
  type: 'element',
  tagName: 'a',
  properties: {href: '#alpha'},
  children: []
}) // => true
 
interactive({
  type: 'element',
  tagName: 'video',
  properties: {controls: true},
  children: []
}) // => true

API

interactive(node)

Parameters
  • node (Node, optional) — Node to check.
Returns

boolean — Whether node is an Element categorised as interactive.

Security

hast-util-interactive 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

Install

npm i hast-util-interactive

DownloadsWeekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

7 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar