fix math output for mediawiki (kind of)