unified

Project: syntax-tree/mdast-util-phrasing

Package: mdast-util-phrasing@2.0.0

  1. Dependencies: 1·Dependents: 3
  2. mdast utility to check if a node is phrasing content
  1. markdown 133
  2. util 118
  3. utility 114
  4. unist 110
  5. mdast 81
  6. phrasing 2

mdast-util-phrasing

Build Coverage Downloads Size Sponsors Backers Chat

Check if a mdast node is phrasing content.

Install

npm:

npm install mdast-util-phrasing

Use

var phrasing = require('mdast-util-phrasing')

phrasing({
  type: 'paragraph',
  children: [{type: 'text', value: 'Alpha'}]
}) // => false

phrasing({
  type: 'strong',
  children: [{type: 'text', value: 'Delta'}]
}) // => true

API

phrasing(node)

Check if the given value is a phrasing element.

Parameters

node (*) — Value to check, typically a node.

Returns

boolean — whether node is phrasing content.

Security

Use of mdast-util-phrasing does not involve hast, user content, or change the 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 © Victor Felder