Allow \color to override link color in SVG output. Resolves issue #427.
This commit is contained in:
parent
c4da088220
commit
557e93e505
|
@ -24,7 +24,7 @@
|
|||
|
||||
MathJax.OutputJax.SVG = MathJax.OutputJax({
|
||||
id: "SVG",
|
||||
version: "2.1.1",
|
||||
version: "2.1.2",
|
||||
directory: MathJax.OutputJax.directory + "/SVG",
|
||||
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
|
||||
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
width: "100%"
|
||||
},
|
||||
|
||||
".MathJax_SVG svg a > g, .MathJax_SVG_Display svg a > g": {
|
||||
".mjx-href": {
|
||||
fill: "blue", stroke: "blue"
|
||||
},
|
||||
|
||||
|
@ -1027,19 +1027,17 @@
|
|||
// for svg element, put <a> inside the main <g> element
|
||||
var g = svg.element.firstChild;
|
||||
while (g.firstChild) {a.appendChild(g.firstChild)}
|
||||
g.appendChild(a);
|
||||
g.appendChild(a); this.SVGaddClass(g,"mjx-href");
|
||||
g.removeAttribute("fill"); g.removeAttribute("stroke");
|
||||
} else {
|
||||
// if removeable, move contents of <g> to <a>, otherise move element to <a>
|
||||
if (svg.removeable && svg.element.nodeName === "g") {
|
||||
while (svg.element.firstChild) {a.appendChild(svg.element.firstChild)}
|
||||
} else {a.appendChild(svg.element)}
|
||||
svg.element = a;
|
||||
this.SVGaddClass(svg.element,"mjx-href");
|
||||
a.appendChild(svg.element); svg.element = a;
|
||||
}
|
||||
svg.removeable = false;
|
||||
}
|
||||
if (SVG.config.addMMLclasses) {
|
||||
this.SVGaddClass(svg.element,"mjx-svg-"+this.type);
|
||||
svg.removeable = false;
|
||||
svg.element.setAttribute("className","mjx-svg-"+this.type);
|
||||
}
|
||||
var style = this.style;
|
||||
if (style && svg.element) {
|
||||
|
@ -1049,6 +1047,10 @@
|
|||
if (svg.removeable) {svg.removeable = svg.element.style.cssText === ""}
|
||||
}
|
||||
},
|
||||
SVGaddClass: function (node,name) {
|
||||
var classes = node.getAttribute("class");
|
||||
node.setAttribute("class",(classes ? classes+" " : "")+name);
|
||||
},
|
||||
//
|
||||
// WebKit currently scrolls to the BOTTOM of an svg element if it contains the
|
||||
// target of the link, so implement link by hand, to the containing span element.
|
||||
|
|
Loading…
Reference in New Issue
Block a user