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

hast-util-transparent

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if node is a transparent element.

Install

npm:

npm install hast-util-transparent

Use

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

transparent({
  type: 'element',
  tagName: 'div',
  children: [{type: 'text', value: 'Alpha'}]
}) // => false

transparent({
  type: 'element',
  tagName: 'a',
  properties: {href: '#bravo', title: 'Charlie'},
  children: [{type: 'text', value: 'Delta'}]
}) // => true

API

transparent(node)

Check if the given value is a transparent element.

Parameters
  • node (*) — Value to check, probably Element.
Returns

boolean — whether node passes the test.

Security

hast-util-transparent 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 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |