Improve shim placement and highlighting for MathML/SVG