hast-util-whitespace
Check whether a HAST node is inter-element
whitespace.
Installation
npm:
npm install hast-util-whitespace
Usage
var whitespace = require('hast-util-whitespace')
whitespace({
type: 'element',
tagName: 'div',
children: []
})
whitespace({
type: 'text',
value: '\t \n'
})
whitespace({
type: 'text',
value: ' text\f'
})
API
whitespace(node|value)
Parameters
node
(Node
, optional) — Node whose value
to check.value
(string
, optional) — Value to check.
Returns
boolean
— Whether the value
(of node
) is inter-element
white-space: consisting of zero or more of space, tab (\t
),
line feed (\n
), carriage return (\r
), or form feed (\f
).
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