File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -622,7 +622,7 @@ function GetSVG(result) {
622
622
//
623
623
var svgdata = svg . outerHTML . replace ( / > < ( [ ^ / ] ) / g, ">\n<$1" )
624
624
. replace ( / ( < \/ [ a - z ] * > ) (? = < \/ ) / g, "$1\n" )
625
- . replace ( / ( < u s e [ ^ > ] * ) ( h r e f = ) / g, ' $1xlink:$2' ) ;
625
+ . replace ( / ( < (?: u s e | i m a g e ) [ ^ > ] * ) ( h r e f = ) / g, ' $1xlink:$2' ) ;
626
626
//
627
627
// The file version includes the xml and DOCTYPE comments
628
628
//
Original file line number Diff line number Diff line change
1
+ var tape = require ( 'tape' ) ;
2
+ var mjAPI = require ( "../lib/mj-single.js" ) ;
3
+ var jsdom = require ( 'jsdom' ) . jsdom ;
4
+
5
+ tape ( 'SVG output: add xlink to href in <image>' , function ( t ) {
6
+ t . plan ( 1 ) ;
7
+ mjAPI . start ( ) ;
8
+ var mml = '<math><mglyph src="equation.svg" width="319pt" height="14pt"></mglyph></math>' ;
9
+ var expected = / x l i n k : h r e f / ;
10
+
11
+ mjAPI . typeset ( {
12
+ math : mml ,
13
+ format : "MathML" ,
14
+ svg : true
15
+ } , function ( data ) {
16
+ t . ok ( data . svg . match ( expected ) ) ;
17
+ } ) ;
18
+ } ) ;
You can’t perform that action at this time.
0 commit comments