annotatedtext-rehype
v1.0.12
Published
A lightweight JavaScript library based on annotatedtext and remark-hype for converting html documents into an annotated text format consumable by LanguageTool as AnnotatedText.
Downloads
116
Maintainers
Readme
annotatedtext-rehype
A lightweight JavaScript library based on annotatedtext and rehype-parse for converting HTML documents into an annotated text format consumable by LanguageTool as AnnotatedText.
Documentation
For details, please see https://www.prosegrinder.com/annotatedtext-rehype.
Install
This package is
ESM only.
Node 12+ is needed to use it, and it must be import
ed instead of require
d.
npm:
npm install annotatedtext-rehype --save
Usage
Use build
to convert valid HTML into
AnnotatedText.
import { build } from "annotatedtext-rehype";
const text = "<p>Some <b>bold</b> text.</p>";
const annotatedtext = build(text);
const ltdata = JSON.stringify(annotatedtext);