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

hast-util-embedded

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if an element is embedded.

Install

npm:

npm install hast-util-embedded

Use

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 node is an embedded element.

Security

hast-util-embedded 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.5                                ...           latest (8 months ago)

6 Versions

  • 1.0.5                                ...           8 months ago
  • 1.0.4                                ...           a year 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 94
This Week 220
This Month 1,755
Last Day 126
Last Week 836
Last Month 3,320
Dependencies (1)
Dev Dependencies (8)

Copyright 2014 - 2016 © taobao.org |