File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ function StartQueue() {
684684 //
685685 GetState ( data . state ) ;
686686
687- var renderer = ( data . html ? "CommonHTML" : "SVG" ) ;
687+ var renderer = ( ( data . html || data . htmlNode ) ? "CommonHTML" : "SVG" ) ;
688688
689689 //
690690 // Set up a timeout timer to restart MathJax if it runs too long,
@@ -784,7 +784,7 @@ function SetRenderer(renderer) {
784784}
785785
786786function RerenderSVG ( result ) {
787- if ( data . html && data . svg ) {
787+ if ( ( data . html || data . htmlNode ) && ( data . svg || data . svgNode ) ) {
788788 timer = setTimeout ( RestartMathJax , data . timeout ) ;
789789 var queue = MathJax . Callback . Queue ( ) , $$ = window . Array ;
790790 return queue . Push (
Original file line number Diff line number Diff line change 1+ var tape = require ( 'tape' ) ;
2+ var mjAPI = require ( "../lib/main.js" ) ;
3+
4+ tape ( 'HTML output when requesting both SVG and HTML' , function ( t ) {
5+ t . plan ( 2 ) ;
6+ mjAPI . start ( ) ;
7+ var tex = 'x' ;
8+
9+ mjAPI . typeset ( {
10+ math : tex ,
11+ format : "TeX" ,
12+ htmlNode : true ,
13+ svgNode : true
14+ } , function ( data ) {
15+ t . equal ( data . htmlNode . className , 'mjx-chtml MJXc-display' , 'htmlNode output is correct' ) ;
16+ } ) ;
17+
18+ mjAPI . typeset ( {
19+ math : tex ,
20+ format : "TeX" ,
21+ html : true ,
22+ svgNode : true
23+ } , function ( data ) {
24+ t . ok ( data . html , 'html output is present' )
25+ } ) ;
26+ } ) ;
You can’t perform that action at this time.
0 commit comments