1

I have the following elixir code that looks like this:

defmodule Drawing do
  use Surface.Component

  def render(assigns) do
    ~H"""
    <svg viewBox={{ "0 0 #{@width} #{@height}" }}>
      {{ SomeElixirCall.here() }}
    </svg>
    """
  end
end

It's elixir outside, with HTML in between ~H""" and """, and elixir inside the html, between {{ and }}.

I have made some mmm config that managed to highlight the html parts and the outer elixir part, but not the elixir inside the html.

Is that possible with mmm, two levels deep mmm'ing? Or maybe I am just doing it wrong? Thanks!

(mmm-add-classes
 '((sf-elixir
    :submode mhtml-mode
    :front "^[ ]*~H\"\"\"$" ;; regex to find the opening tag
    :back "^[ ]*\"\"\"$"))) ;; regex to find the closing tag

(mmm-add-mode-ext-class 'elixir-mode nil 'sf-elixir)

(mmm-add-classes
 '((elixir-sf
    :submode elixir-mode
    :front "{{" ;; regex to find the opening tag
    :back "}}"))) ;; regex to find the closing tag

(mmm-add-mode-ext-class 'mhtml-mode nil 'elixir-sf)

1 Answer 1

1

I've asked in the github repo, and it seems to not be supported at the moment, but could be implemented soon: https://github.com/purcell/mmm-mode/issues/102

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.