You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Type should be exported from index.ts: I need Type in order to post-process the Markdown AST. However, although Type is exported from markdown.ts, it's not accessible through the module root. My bundler can't seem to resolve import "@lezer/markdown/dist/markdown" so it's not easy for me to import it from the file directly.
BlockResult should be exported: this type appears in a public interface (BlockParser.parse), so it would be nice to name it directly.
InlineContext constructor 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 an InlineContext for 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 the InlineContext constructor, which isn't exported.
If you're ok with any of these, let me know and I will put up a pull request.
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.