Skip to content

syntax-tree/hast-util-embedded

hast-util-embedded Build Coverage Downloads Chat

Check if a node is an embedded element.

Installation

npm:

npm install hast-util-embedded

Usage

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

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

// Given a embedded element:
embedded({
  type: 'element',
  tagName: 'audio',
  properties: {src: 'delta.ogg'},
  children: []
}) // => true

API

embedded(node)

Check if the given value is an embedded element.

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 an embedded element

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •