Via {T261857} we already merged all of the customizations we made to the upstream addon, notably [this commit](https://gitlab.com/wmde/mediawiki-extensions-CodeMirror/-/commit/a1eed46e9260a3750a0aa1d7a076cd7120c21d8e). While the quality of this code isn't bad, it was created as proof-of-concept code and never fully finished:
[x] There should be a comment in the file that points to the original source: https://github.com/codemirror/CodeMirror/blob/a966b5d115af09983d37f7c9aa034b78ac954ca4/addon/edit/matchbrackets.js
[x] The same comment should briefly explain our customizations, and possibly point to a diff or patch.
[x] There are multiple FIXME comments in the code. These need to be fixed, or the comments removed.
[x] The new code doesn't respect any limits. (Also see the related task T270237.)
[] Is the performance still ok when the wikitext is very complex, with very long lines, and many brackets must be skipped?
[] To do: Test again with a 10,000 characters paragraph that contains thousands of links. Make sure possible performance issue are not caused by the matchbrackets addon.
[x] There are no tests → moved to T270240.
Here are some flame graphs for wikitexts with varying complexity. While the matchbrackets code is not an obvious issue, it's not free either.
{F33947294}
{F33947295}