Closed polyrainbow closed 1 year ago
Closing this as the PR is stale and I'm not fond of this non-type-safe implementation anymore. I might try my hand at an updated TypeScript parser when the spec or the Rust implementation have become more stable.
This is a JavaScript parser for Subtext with streaming capability. Since I am using something similar for my own notes app, I thought I might as well provide a parser for this repo.
It uses the Web Streams API which means it can be used with compatible browsers and server runtimes like Node.js and Deno. The parser does not have any dependency.
I have included the example from the Rust parser and some tests from the Rust test suite.
You can run the example via
npm run example
and run tests vianpm run test
.Feel free to suggest improvements or close the request if it does not match your requirements. If you prefer TypeScript, I could also make the adjustments.