Add custom TextMate code language support#406
Open
rossirpaulo wants to merge 1 commit into
Open
Conversation
rossirpaulo
marked this pull request as ready for review
July 16, 2026 01:11
Author
|
I'm adding this feature since I'm trying to move off Obsidian and I build a programming language. It's hard to move off if it means my snippets don't have custom highlighting. Hope this helps and gets merged. Lmk if you need help reviewing. |
Author
|
@adibhanna, any steps that I need to take to get this PR some momentum? lmk if there's anything not documented in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds desktop support for importing self-contained TextMate JSON grammars and using their fence tags in both the editor and rendered Markdown.
Users can add, preview, enable, edit, reveal, and remove custom languages from Settings → Editor → Languages. Installed grammars are stored in the machine-wide ZenNotes config directory and update open editor and preview surfaces without changing note files.
The runtime keeps built-in language and diagram tags reserved, rejects grammars with unsupported external scope dependencies, bounds grammar and code-block sizes, and loads TextMate/Oniguruma only when needed. The Oniguruma WASM is embedded and decoded locally instead of fetched, so it works with Electron's CSP and packaged file URLs.
Validation completed: