Highlight or underline matching (), {} and [] in Anki html editor

I have a big collection of cards related to programming and maths. The content of these cards very often contains multiple pairs of (), {} and [ ]. For this reason, I can’t edit such cards in Anki’s built-in html editor efficiently because this editor doesn’t highlight/underline the corresponding parenthesis/curly brace/bracket when I click on one of the (, {, [, ), }, ] symbols. Please add this feature to Anki or one of its addons. Almost every popular text editor has this feature (Sublime Text, Vim, Atom, etc.), so I think it is necessary for convenient editing (of cards related to programming, maths, chemistry, physics, etc.).

See below the example of such underlining in Sublime Text (on the left side of the image; on the right is the corresponding Mathjax rendering):

And below is the example of such highlighting in Vim:
vim

3 Likes

It seems that Anki uses codemirror for its html editor. Codemirror’s manual says that there is the matchbrackets extension, which does exactly what I want – highlight matching brackets. Anki’s source file loads several codemirror extensions (addons), but unfortunately not the matchbrackets extension. I’m wondering why - is it because of efficiency/speed or for some other reason? And is it possible to create an Anki addon that will load the matchbrackets extension in Anki?

1 Like

I don’t think we deliberately excluded it in Anki, but I’d like to see us update to the latest CodeMirror before we start adding extra extensions, as the CM 5→6 switch is quite involved.