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

hast-util-phrasing

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to check if a node is phrasing content.

Install

npm:

npm install hast-util-phrasing

Use

var phrasing = require('.')

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

// Given a phrasing element:
phrasing({
  type: 'element',
  tagName: 'meta',
  properties: {itemProp: 'bravo'},
  children: []
})
// => true

// Given a non-phrasing element:
phrasing({
  type: 'element',
  tagName: 'meta',
  properties: {charSet: 'utf8'},
  children: []
})
// => false

// Given text:
phrasing({type: 'text', value: 'Delta'})
// => true

API

phrasing(node)

Check if the given value is phrasing content.

Parameters
  • node (*) — Value to check, typically Node.
Returns

boolean — Whether node passes the test.

Security

hast-util-phrasing 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                                ...           4 years ago
Maintainers (2)
Downloads
Today 2
This Week 175
This Month 1,263
Last Day 60
Last Week 326
Last Month 2,142
Dev Dependencies (10)

Copyright 2014 - 2017 © taobao.org |