Physikerwelt has submitted this change and it was merged. Change subject: Massage SVG by removing some styles as well ......................................................................
Massage SVG by removing some styles as well Change-Id: I8d3cec0ee8a8c9368b7dca89e1d5e0c5683f946c --- M mathoid-worker.js 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Physikerwelt: Verified; Looks good to me, approved diff --git a/mathoid-worker.js b/mathoid-worker.js index afc8551..6f33763 100644 --- a/mathoid-worker.js +++ b/mathoid-worker.js @@ -83,9 +83,18 @@ data.success = true; data.log = "success"; } + + // Temporary work-around for a duplicate attribute (invalid XML) + // returned by MathJax. if (data.mml) { data.mml = data.mml.replace(/displaystyle="true" (?=displaystyle)/, ''); } + + // Strip some styling returned by MathJax + if (data.svg) { + data.svg = data.svg.replace(/(style="[^"]*)(?:margin|position):[^;]+;/, '$1'); + } + res.writeHead(200, { 'Content-Type': 'application/json' -- To view, visit https://gerrit.wikimedia.org/r/165948 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d3cec0ee8a8c9368b7dca89e1d5e0c5683f946c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mathoid Gerrit-Branch: master Gerrit-Owner: GWicke <gwi...@wikimedia.org> Gerrit-Reviewer: Physikerwelt <w...@physikerwelt.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits