We switched to a manual approval system for registration on this forum, as this makes it easier to keep bots out of the forum. We'll approve everybody who doesn't look like a bot!

Code discussion: How to apply styles to arbitrary patterns?

On a recent PR I fixed code blocks to conform to CommonMark spec, so you can do this:

```sh other:text here

and it correctly identifies the language now, even with the extraneous text in there, which previously caused the language to be undetectable.
However, the highlighting of that line now ends with the recognized ```sh text, leaving the rest a blinding white mess that really visually detracts from the content.

How can I apply the same style to the extraneous stuff after a codefence start sequence, as the codefence start sequence style itself? I don't understand well enough the Zettlr / CodeMirror coupling to know how to do this.

Comments

  • Short answer: You don't, because that's the way the multiplex mode pulls in the syntax highlighting modes …

  • The conclusion is then that this is an upstream issue and can't be solved at the Zettlr level.

  • Oh, I'm a dummy. It's still fixable through regex modification. I'll update my PR.

  • Just saw it aaand I think even merged by now? I have no overview over what I'm doing atm :D

Sign In or Register to comment.