hast-util-to-nlcst under the hood.
See its documentation to learn how to ignore nodes.
npm install rehype-retext
example.html looks as follows:
Hello!A implicit sentence.This and and that.
example.js like this:
var vfile =var report =var unified =var parse =var minify =var stringify =var rehype2retext =var english =var indefinite =var repeated =
node example yields:
example.html5:3-5:4 warning Use `An` before `implicit`, not `A` retext-indefinite-article retext-indefinite-article6:12-6:19 warning Expected `and` once, not twice retext-repeated-words retext-repeated-words⚠ 2 warningsHello!A implicit sentence.This and and that.
destination is either a parser or a processor.
If a processor (
Unified) is given, runs the destination
processor with the new nlcst tree, then, after running discards that tree and
continues on running the origin processor with the original tree
As HTML defines paragraphs, that definition is used for
<h1-6> are explicitly
supported, and implicit paragraphs in flow content are also supported.
rehype-retext does not change the syntax tree so there are no openings for
cross-site scripting (XSS) attacks.
rehype-remark— Transform HTML (hast) to Markdown (mdast)
remark-retext— Transform Markdown (mdast) to natural language (nlcst)
remark-rehype— Transform Markdown (mdast) to HTML (hast)
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.