Open grandslammer opened 4 years ago
You need to tell markdown what language it should use for syntax highlighting:
Thanks, is there any kind of shortcut or auto detect feature for this? The editor has an auto detect feature. Perhaps it could be incorporated into code blocks also?
Currently that is not possible for code blocks. Auto-detecting it for code blocks could maybe work. It should only be triggered on a specific shortcut though.
I don't think such a feature would be in high demand as just typing out the few characters does not take a lot of time, and there are no possible interpretation mistakes if it is done manually. Cause I could easily imagine the auto-detect going wrong with tiny code snippets.
That being said, this is an OSS project, so if somebody feels like implementing this feature, then don't let me stop you.
This sounds like a useful feature to me. I could take a look at this in the future. Maybe either with the help of the library as a dependency https://github.com/highlightjs/highlight.js/blob/master/src/highlight.js or inspiration from there.
@nammn That looks like a good library to use. If we could only use the autodetecting part of the library, then that would be preferable, as we already have CodeMirror to take care of highlighting.
I have no syntax highlighting within my code blocks (see screenshot). All my settings seem to be correct.