Hey,
i created my own language with Lezer that looks something like that:
@top Program {
((Text+) end)*
}
Formatter {
Bold |
Italic |
Underline
}
textLine {
Text |
Formatter |
}
Bold { "*" Text "*" }
Italic { "/" Text "/" }
Underline { "_" Text "_" }
@tokens {
Text { (![*/_{}\[\]\t\n\r])+ }
}
@detectDelim
the html output of the codemirror editor looks like this:
<div class="cm-line">
<span class="text">Some </span>
<span class="bold">*</span>
<span class="text">Text</span>
<span class="bold">*</span>
<span class="text">! </span>
</div>
That’s fine, but I want to style the text within the bold part. At the moment this is not possible because the html is not nested. Is there any way I can get codemirror to nest siblings? So that the HTML looks something like this:
<div class="cm-line">
<span class="text">Some </span>
<span class="bold">* <span class="text">Text</span> *</span>
<span class="text">! </span>
</div>