Skip to content

How to make the overlayMode working? #495

@naitsok

Description

@naitsok

Hello to all the developers of EasyMDE. Thanks for such a great editor!

I would like add additional highlighting during editing. In particular, I want to highlight TeX/LaTeX equations. I've found the CodeMirrors's "stex" mode, but I'm struggling to make it load using the overlayMode option.

What I've done:
I followed this guide on Hinty to add "stex" mode to the easymde.min.js. Everything should be correct as the size of easymde.min.js increased after adding "stex" mode.

Next, I tried different options to add the "stex" mode to overlayMode:

overlayMode: {
            mode: { name: "stex", inMathMode: false },
            combine: true,
        },

Then I've tried to create the mode object using CodeMirror.defineMode(...), and CodeMirror.getMode(...).

However, with no success in parsing and highlighting LaTeX equations during the editing. I'm sure that the solution is simple, but I couldn't get it working after searching and reading CodeMirror's docs. What am I doing wrong?
Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions