File tree 2 files changed +22
-3
lines changed
2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -549,9 +549,8 @@ function GetSpeech(result) {
549
549
function GetSemantic ( result ) {
550
550
if ( ! data . semantic ) return ;
551
551
result . streeJson = speech . toJson ( result . mml ) ;
552
- result . streeXml = data . minSTree ?
553
- speech . toSemantic ( result . mml ) :
554
- speech . pprintXML ( speech . toSemantic ( result . mml ) ) ;
552
+ var xml = speech . toSemantic ( result . mml ) . toString ( ) ;
553
+ result . streeXml = data . minSTree ? xml : speech . pprintXML ( xml ) ;
555
554
}
556
555
557
556
//
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 ( 'semanticTree: basic test' , function ( t ) {
5
+ t . plan ( 2 ) ;
6
+
7
+ var tex = 'a+b=c' ;
8
+ mjAPI . start ( ) ;
9
+
10
+ mjAPI . typeset ( {
11
+ math : tex ,
12
+ format : "TeX" ,
13
+ mml : true ,
14
+ speakText : true ,
15
+ semantic : true
16
+ } , function ( data ) {
17
+ t . ok ( data . streeJson , 'semantic tree JSON' ) ;
18
+ t . ok ( data . streeXml , 'semantic tree XML' ) ;
19
+ } ) ;
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments