Skip to content

syntax-tree/hast-util-interactive

Repository files navigation

hast-util-interactive Build Status Coverage Status

Check whether a HAST node is interactive.

Installation

npm:

npm install hast-util-interactive

Usage

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.

Contribute

See contributing.md in syntax-tree/hast for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

About

utility to check if a node is interactive

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •