Check whether a HAST node is inter-element whitespace.
npm:
npm install hast-util-whitespaceDependencies:
var whitespace = require('hast-util-whitespace');
whitespace({
type: 'element',
tagName: 'div',
children: []
}); //=> false
whitespace({
type: 'text',
value: '\t \n'
}); //=> true
whitespace({
type: 'text',
value: ' text\f'
}); //=> falsenode(Node, optional) — Node whosevalueto check.value(string, optional) — Value to check.
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).
See contribute.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.