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 @@ -627,7 +627,7 @@ function GetSVG(result) {
627
627
//
628
628
var svgdata = svg . outerHTML . replace ( / > < ( [ ^ / ] ) / g, ">\n<$1" )
629
629
. replace ( / ( < \/ [ a - z ] * > ) (? = < \/ ) / g, "$1\n" )
630
- . replace ( / ( < u s e [ ^ > ] * ) ( h r e f = ) / g, ' $1xlink:$2' ) ;
630
+ . replace ( / ( < (?: u s e | i m a g e ) [ ^ > ] * ) ( h r e f = ) / g, ' $1xlink:$2' ) ;
631
631
//
632
632
// The file version includes the xml and DOCTYPE comments
633
633
//
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