rehypejs / rehype-retext Goto Github PK
View Code? Open in Web Editor NEWplugin to transform from HTML (rehype) to prose (retext)
Home Page: https://unifiedjs.com
License: MIT License
plugin to transform from HTML (rehype) to prose (retext)
Home Page: https://unifiedjs.com
License: MIT License
https://stackblitz.com/edit/github-mfdkiw?file=example.js
node example.js
As per readme, I expected
example.html
5:3-5:4 warning Use `An` before `implicit`, not `A` retext-indefinite-article retext-indefinite-article
6:12-6:19 warning Expected `and` once, not twice and retext-repeated-words
⚠ 2 warnings
and
<!doctypehtml><meta charset=utf8><title>Hello!</title><article>A implicit sentence.<h1>This and and that.</h1></article>
to be logged.
The following error is logged.
Error: parser.tokenize is not a function
at _evaluate (https://zzmimxpqlgithub-wfd2.w-corp-staticblitz.com/blitz.9e2d28a3.js:40:786645)
Node.js 18.20.3
Note: When using TypeScript, there's also the following type error:
Argument of type '[Processor<Root, Root, undefined, undefined, undefined>]' is not assignable to parameter of type '[boolean] | [parser: Parser]'.
Type '[Processor<Root, Root, undefined, undefined, undefined>]' is not assignable to type '[boolean]'.
Type 'Processor<Root, Root, undefined, undefined, undefined>' is not assignable to type 'boolean'.
I removed TS from the reproduction to keep it truly minimal, however.
No response
No response
No response
No response
Addendum: Curiously enough, on Safari the minimal repro doesn't consistently log the error for me (it still doesn't work, though). On Chrome and Firefox the error is logged consistently. This feels like it's probably unrelated to this project, however.
When using these with other newer packages that use Hast 3, we get errors due to typing mismatches.
Upgrade @types/hast to 3. I tried to do this myself, but ran into issues with TypeScript complaining about this
bindings somehow.
While I'm experienced with TS and such, I feel like I'm lacking some context to fix this issues. If I could be helped a bit, I'd be happy to submit PRs across the ecosystem to help us all get upgraded :)
readme.md
This ---------> rehype-remark — Transform HTML (hast) to Markdown (mdast)
has the wrong link in it. It links to rehype-retext and not rehype-remark
(edit by woorm to clean issue)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.