deathau / cm-editor-syntax-highlight-obsidian

A plugin for [Obsidian](https://obsidian.md) which allows syntax highlighting for code blocks in the editor.
486 stars 37 forks source link

Expose syntax highlighting through an API for use by other plugins #51

Open MostlyArmless opened 1 year ago

MostlyArmless commented 1 year ago

I use the obsidian-spaced-repetition plugin to make flashcards to study programming topics, but when the flashcard content is displayed by the other plugin it doesn't have any syntax highlighting. It would be great if this plugin had an API which I could call from over in the obsidian-spaced-repetition plugin to do something like syntaxHighlightApi.highlightMarkdown(codeFenceTextToHighlight) which would return some HTML with inline styles, perhaps. Just spitballing here.

Raw note content with the syntax highlighting working: image

What it looks like when rendered by the obsidian-spaced-repetition plugin as a flashcard: image