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
Hey there, I initially thought about forking the package to add a small feature but decided it would be cleaner to refactor it a little instead. I've already created a PR with the changes but thought I'd open an issue first to discuss.
I've added support for consumers of the package to pass custom language grammars via a langConfig option. This allows extending the syntax highlighting without modifying the core library.
Usage
importlangLuafrom"shiki/langs/lua.mjs";const{ html }=processMarkdown({md: mdWithLua,// Your markdown string with Lua code blockslangConfig: {langs: [langLua],// Add custom Lua language grammar// aliases: {} can be added too if needed},});
If this feature aligns with the direction of the project, I’d be happy to finalise the pull request. Let me know if you'd like any changes.
Thanks for considering!
The text was updated successfully, but these errors were encountered:
jasonnathan
changed the title
Add Support for Custom Language Grammars in processMarkdown
Add Support for Custom Language Grammars and Optional Frontmatter in processMarkdown
Sep 22, 2024
jasonnathan
changed the title
Add Support for Custom Language Grammars and Optional Frontmatter in processMarkdown
Add Support for Custom Language Grammars in processMarkdown
Sep 22, 2024
Hey there, I initially thought about forking the package to add a small feature but decided it would be cleaner to refactor it a little instead. I've already created a PR with the changes but thought I'd open an issue first to discuss.
I've added support for consumers of the package to pass custom language grammars via a
langConfig
option. This allows extending the syntax highlighting without modifying the core library.Usage
If this feature aligns with the direction of the project, I’d be happy to finalise the pull request. Let me know if you'd like any changes.
Thanks for considering!
The text was updated successfully, but these errors were encountered: