@@ -172,6 +172,88 @@ describe('Tagformat', () => {
172172
173173 /********************************************************************************/
174174
175+ test ( 'Array tag' , ( ) => {
176+ setupTex ( [ 'base' , 'ams' , 'tagformat' ] , {
177+ tagformat : {
178+ tag : ( tag : string ) => [ '|' , tag , '|' ] ,
179+ } ,
180+ tags : 'ams'
181+ } ) ;
182+ toXmlMatch (
183+ tex2mml ( 'x \\tag{1}' ) ,
184+ `<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="x \\tag{1}" display="block">
185+ <mtable displaystyle="true" data-latex="x \\tag{1}">
186+ <mlabeledtr>
187+ <mtd id="mjx-eqn:1">
188+ <mtext data-latex="\\text{|}">|</mtext>
189+ <mtext data-latex="\\text{1}">1</mtext>
190+ <mtext data-latex="\\text{|}">|</mtext>
191+ </mtd>
192+ <mtd>
193+ <mi data-latex="\\tag{1}">x</mi>
194+ </mtd>
195+ </mlabeledtr>
196+ </mtable>
197+ </math>`
198+ ) ;
199+ } ) ;
200+
201+ /********************************************************************************/
202+
203+ test ( 'Array tag with empty entry' , ( ) => {
204+ setupTex ( [ 'base' , 'ams' , 'tagformat' ] , {
205+ tagformat : {
206+ tag : ( tag : string ) => [ '' , tag , '.' ] ,
207+ } ,
208+ tags : 'ams'
209+ } ) ;
210+ toXmlMatch (
211+ tex2mml ( 'x \\tag{1}' ) ,
212+ `<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="x \\tag{1}" display="block">
213+ <mtable displaystyle="true" data-latex="x \\tag{1}">
214+ <mlabeledtr>
215+ <mtd id="mjx-eqn:1">
216+ <mtext data-latex="\\text{1}">1</mtext>
217+ <mtext data-latex="\\text{.}">.</mtext>
218+ </mtd>
219+ <mtd>
220+ <mi data-latex="\\tag{1}">x</mi>
221+ </mtd>
222+ </mlabeledtr>
223+ </mtable>
224+ </math>`
225+ ) ;
226+ } ) ;
227+
228+ /********************************************************************************/
229+
230+ test ( 'Array tag with null entry' , ( ) => {
231+ setupTex ( [ 'base' , 'ams' , 'tagformat' ] , {
232+ tagformat : {
233+ tag : ( tag : string ) => [ , tag , '.' ] ,
234+ } ,
235+ tags : 'ams'
236+ } ) ;
237+ toXmlMatch (
238+ tex2mml ( 'x \\tag{1}' ) ,
239+ `<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="x \\tag{1}" display="block">
240+ <mtable displaystyle="true" data-latex="x \\tag{1}">
241+ <mlabeledtr>
242+ <mtd id="mjx-eqn:1">
243+ <mtext data-latex="\\text{1}">1</mtext>
244+ <mtext data-latex="\\text{.}">.</mtext>
245+ </mtd>
246+ <mtd>
247+ <mi data-latex="\\tag{1}">x</mi>
248+ </mtd>
249+ </mlabeledtr>
250+ </mtable>
251+ </math>`
252+ ) ;
253+ } ) ;
254+
255+ /********************************************************************************/
256+
175257} ) ;
176258
177259/**********************************************************************************/
0 commit comments