Please include highlighting for Elixir in Live Preview.
My understanding is that you use Prism.js for read mode, but I’m not sure what you’re using for live preview mode. Perhaps a modified version of CodeMirror’s own?
It seems that with CM6 they want to maintain only a subset of languages currently of interest to the devs, so additional languages need to be included manually.
This is one mentioned on the CM Github if that is the case:
Steps to reproduce
- Open sandbox
- Insert a code block like this:
defmodule Math do
def sum(a, b) do
a + b
end
end
Expected result
The code should be syntax highlighted.
Example appearance using the old Syntax Editor Highlight plugin:
Actual result
The code is not syntax highlighted.
Additional information
Related discussions:
- Elixir language syntax highlight doesn't work in editing mode (either live preview mode or sourcecode mode) - #2 by WhiteNoise
- Elixir syntax highlighting is not available - #4 by ObsidianElixirDev
These seem to be closed because they were introduced as bugs. This started that way too because it feels like one.
If you are not using CM6 for Live Preview highlighting, I can look into whatever you are using. It seems to work for a lot of languages already, from Lisp to Rust.