Add Elixir Syntax Hilighting for Live Preview

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

  1. Open sandbox
  2. Insert a code block like this:
defmodule Math do
  def sum(a, b) do
    a + b

Expected result

The code should be syntax highlighted.

Example appearance using the old Syntax Editor Highlight plugin:

Screenshot from 2023-12-05 16-31-22

Actual result

The code is not syntax highlighted.

Screenshot from 2023-12-05 16-32-22

Additional information

Related discussions:

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.