Skip to content

Latest commit

 

History

History

rehype-minify-whitespace

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@starptech/rehype-minify-whitespace

Collapse whitespace.

Normally, collapses to a single space. If newlines: true, collapses white-space containing newlines to '\n' instead of ' '.

Installation

npm install --save @starptech/rehype-minify-whitespace

Usage

In
<h1>Heading</h1>
···→ →···foo···→
<p><strong>This</strong> and <em>that</em></p>
Out
<h1>Heading</h1>
foo
<p><strong>This</strong> and <em>that</em></p>

Api

node.data.ignore

When this property is true the node is skipped for whitespace handling.

node.data.preserveWhitespace

When this property is true the node is skipped for whitespace handling.

Caveats

The implementation is a modified version of Rehype rehype-minify-whitespace 2.0.3