-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
For Nota, I have implemented a new syntax as a Markdown extension using the interface in @lezer-parser/markdown: https://github.com/nota-lang/nota/blob/markdown/packages/nota-syntax/lib/parse.ts
Everything worked quite well -- great job on the flexible API design! But I ran into a few cases where I needed functionality that's currently private to markdown.ts. I'd like to show what those cases are, and in turn propose they be exported.
Typeshould be exported fromindex.ts: I needTypein order to post-process the Markdown AST. However, althoughTypeis exported frommarkdown.ts, it's not accessible through the module root. My bundler can't seem to resolveimport "@lezer/markdown/dist/markdown"so it's not easy for me to import it from the file directly.BlockResultshould be exported: this type appears in a public interface (BlockParser.parse), so it would be nice to name it directly.InlineContextconstructor should be exported: similar to the problems described in Line objects should maybe have a char() function equivalent to InlineContext.char() #6, I had issues dealing with relative vs. global indexes inside block parsers. My solution was to just construct anInlineContextfor a given line, use absolute indexes everywhere, and then let the context methods handle the translation to relative indexes for me. But this strategy requires access to theInlineContextconstructor, which isn't exported.
If you're ok with any of these, let me know and I will put up a pull request.
Metadata
Metadata
Assignees
Labels
No labels