Hi Community! Hope you are doing fine. I’m working with Codemirror inside a React app, and I wanted to know if there’s a way to combine two modes: htmlmixed and stex. I managed to get both modes working separately, but there are some cases were I want to highlight html tags and latex code.
I saw an example that hoes something like this:
CodeMirror.defineMode('stex_html', function (config) {
return CodeMirror.multiplexingMode(
CodeMirror.getMode(config, 'text/html'), {
mode: CodeMirror.getMode(config, 'text/stex')
})
})
But I can’t get it working.
Here’s an example of the code I want to parse:
<p>A \\( ???mA??? \text{-kg} \\) object A is connected with a massless string across a massless, frictionless pulley to a \\( ???mB??? \text{-kg} \\) object B. Object A rests on a nearly frictionless plane, which is tilted at an angle \\( \theta \\) of \\( ???thetadeg???^{\circ} \\) as shown.</p>
Thanks in advance for the help!