I wrote some Logseq syntax parsers for Codemirror for another project, and I’m thinking of porting those into Obsidian since it also uses Codemirror. I’m using ViewPlugins and StateFields that rely on a custom parser that adds nodes to the syntaxTree, but it seems that Obsidian has no way to extend its default parser right? Or am I missing something?
I have been able to replace the default parser with my custom parser, which would fulfill my use case, but of course I want to avoid that as much as possible to preserve default behavior as much as possible. I can also probably do some hacky parser wrapping, like injecting obsidian’s parser inside my own parser and return Obsidian’s syntax nodes along with my own syntax nodes but that would mean parsing the same document twice everytime.
Hoping someone can point me to the right direction or confirm that adding syntax nodes to the default parser is supported. Thanks!