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)