Change https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/655884 might fix a lot of seemingly unrelated bugs that caused strip markers to appear when <math> tags were used. I'm going to review them.
To review (after the patch is in production):
T138453
T127738
T209446
T236052
T236629
T242327
T238271
T266182