mathml-spec.js.snap 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. // Jest Snapshot v1, https://goo.gl/fbAQLP
  2. exports[`A MathML builder \\html@mathml makes clean symbols 1`] = `
  3. <math>
  4. <semantics>
  5. <mrow>
  6. <mtext>
  7. ©
  8. </mtext>
  9. <mi mathvariant="normal">
  10. </mi>
  11. <mi mathvariant="normal">
  12. </mi>
  13. <mi mathvariant="normal">
  14. </mi>
  15. <mtext>
  16. KaTeX
  17. </mtext>
  18. </mrow>
  19. <annotation encoding="application/x-tex">
  20. \\copyright\\neq\\notin≘\\KaTeX
  21. </annotation>
  22. </semantics>
  23. </math>
  24. `;
  25. exports[`A MathML builder \\text fonts become mathvariant 1`] = `
  26. <math>
  27. <semantics>
  28. <mrow>
  29. <mtext>
  30. roman
  31. </mtext>
  32. <mrow>
  33. <mtext mathvariant="italic">
  34. italic
  35. </mtext>
  36. <mrow>
  37. <mtext mathvariant="bold-italic">
  38. bold
  39. </mtext>
  40. <mtext>
  41. </mtext>
  42. <mtext mathvariant="bold-italic">
  43. italic
  44. </mtext>
  45. </mrow>
  46. </mrow>
  47. <mtext mathvariant="bold">
  48. bold
  49. </mtext>
  50. <mrow>
  51. <mtext mathvariant="sans-serif">
  52. ss
  53. </mtext>
  54. <mrow>
  55. <mtext mathvariant="sans-serif-italic">
  56. italic
  57. </mtext>
  58. <mrow>
  59. <mtext mathvariant="sans-serif-bold-italic">
  60. bold
  61. </mtext>
  62. <mtext>
  63. </mtext>
  64. <mtext mathvariant="sans-serif-bold-italic">
  65. italic
  66. </mtext>
  67. </mrow>
  68. </mrow>
  69. <mtext mathvariant="bold-sans-serif">
  70. bold
  71. </mtext>
  72. </mrow>
  73. <mrow>
  74. <mtext mathvariant="monospace">
  75. tt
  76. </mtext>
  77. <mrow>
  78. <mtext mathvariant="monospace">
  79. italic
  80. </mtext>
  81. <mrow>
  82. <mtext mathvariant="monospace">
  83. bold
  84. </mtext>
  85. <mtext>
  86. </mtext>
  87. <mtext mathvariant="monospace">
  88. italic
  89. </mtext>
  90. </mrow>
  91. </mrow>
  92. <mtext mathvariant="monospace">
  93. bold
  94. </mtext>
  95. </mrow>
  96. </mrow>
  97. <annotation encoding="application/x-tex">
  98. \\text{roman\\textit{italic\\textbf{bold italic}}\\textbf{bold}\\textsf{ss\\textit{italic\\textbf{bold italic}}\\textbf{bold}}\\texttt{tt\\textit{italic\\textbf{bold italic}}\\textbf{bold}}}
  99. </annotation>
  100. </semantics>
  101. </math>
  102. `;
  103. exports[`A MathML builder accents turn into <mover accent="true"> in MathML 1`] = `
  104. <math>
  105. <semantics>
  106. <mrow>
  107. <mover accent="true">
  108. <mi>
  109. u
  110. </mi>
  111. <mo>
  112. ¨
  113. </mo>
  114. </mover>
  115. <mi>
  116. b
  117. </mi>
  118. <mi>
  119. e
  120. </mi>
  121. <mi>
  122. r
  123. </mi>
  124. <mi>
  125. f
  126. </mi>
  127. <mi>
  128. i
  129. </mi>
  130. <mi>
  131. a
  132. </mi>
  133. <mi>
  134. n
  135. </mi>
  136. <mi>
  137. c
  138. </mi>
  139. <mover accent="true">
  140. <mi>
  141. e
  142. </mi>
  143. <mo>
  144. ˊ
  145. </mo>
  146. </mover>
  147. <mi>
  148. e
  149. </mi>
  150. </mrow>
  151. <annotation encoding="application/x-tex">
  152. über fiancée
  153. </annotation>
  154. </semantics>
  155. </math>
  156. `;
  157. exports[`A MathML builder ligatures render properly 1`] = `
  158. <math>
  159. <semantics>
  160. <mrow>
  161. <mtext>
  162. “‘Hi—-”’
  163. </mtext>
  164. <mo>
  165. </mo>
  166. <mo>
  167. </mo>
  168. <mtext mathvariant="monospace">
  169. \`\`‘Hi----&#x27;&#x27;’
  170. </mtext>
  171. <mrow>
  172. <mtext>
  173. \`\`
  174. </mtext>
  175. <mtext mathvariant="monospace">
  176. ‘Hi
  177. </mtext>
  178. <mtext>
  179. ---
  180. </mtext>
  181. <mtext mathvariant="monospace">
  182. -
  183. </mtext>
  184. <mtext>
  185. &#x27;&#x27;
  186. </mtext>
  187. <mtext mathvariant="monospace">
  188. </mtext>
  189. </mrow>
  190. </mrow>
  191. <annotation encoding="application/x-tex">
  192. \\text{\`\`\`Hi----&#x27;&#x27;&#x27;}--\\texttt{\`\`\`Hi----&#x27;&#x27;&#x27;}\\text{\\tt \`\`\`Hi----&#x27;&#x27;&#x27;}
  193. </annotation>
  194. </semantics>
  195. </math>
  196. `;
  197. exports[`A MathML builder normal spaces render normally 1`] = `
  198. <math>
  199. <semantics>
  200. <mrow>
  201. <mspace width="1em">
  202. </mspace>
  203. <mspace width="0.431em">
  204. </mspace>
  205. </mrow>
  206. <annotation encoding="application/x-tex">
  207. \\kern1em\\kern1ex
  208. </annotation>
  209. </semantics>
  210. </math>
  211. `;
  212. exports[`A MathML builder should concatenate digits into single <mn> 1`] = `
  213. <math>
  214. <semantics>
  215. <mrow>
  216. <mi>
  217. sin
  218. </mi>
  219. <mo>
  220. </mo>
  221. <mi>
  222. α
  223. </mi>
  224. <mo>
  225. =
  226. </mo>
  227. <mn>
  228. 0.34
  229. </mn>
  230. </mrow>
  231. <annotation encoding="application/x-tex">
  232. \\sin{\\alpha}=0.34
  233. </annotation>
  234. </semantics>
  235. </math>
  236. `;
  237. exports[`A MathML builder should generate <mphantom> nodes for \\phantom 1`] = `
  238. <math>
  239. <semantics>
  240. <mrow>
  241. <mphantom>
  242. <mi>
  243. x
  244. </mi>
  245. </mphantom>
  246. </mrow>
  247. <annotation encoding="application/x-tex">
  248. \\phantom{x}
  249. </annotation>
  250. </semantics>
  251. </math>
  252. `;
  253. exports[`A MathML builder should generate the right types of nodes 1`] = `
  254. <math>
  255. <semantics>
  256. <mrow>
  257. <mi>
  258. sin
  259. </mi>
  260. <mo>
  261. </mo>
  262. <mi>
  263. x
  264. </mi>
  265. <mo>
  266. +
  267. </mo>
  268. <mn>
  269. 1
  270. </mn>
  271. <mtext>
  272. &ThickSpace;
  273. </mtext>
  274. <mtext>
  275. a
  276. </mtext>
  277. </mrow>
  278. <annotation encoding="application/x-tex">
  279. \\sin{x}+1\\;\\text{a}
  280. </annotation>
  281. </semantics>
  282. </math>
  283. `;
  284. exports[`A MathML builder should make prime operators into <mo> nodes 1`] = `
  285. <math>
  286. <semantics>
  287. <mrow>
  288. <msup>
  289. <mi>
  290. f
  291. </mi>
  292. <mo mathvariant="normal">
  293. </mo>
  294. </msup>
  295. </mrow>
  296. <annotation encoding="application/x-tex">
  297. f&#x27;
  298. </annotation>
  299. </semantics>
  300. </math>
  301. `;
  302. exports[`A MathML builder should output \\limsup_{x \\rightarrow \\infty} correctly in \\textstyle 1`] = `
  303. <math>
  304. <semantics>
  305. <mrow>
  306. <msub>
  307. <mo>
  308. <mi mathvariant="normal">
  309. lim&ThinSpace;sup
  310. </mi>
  311. <mo>
  312. </mo>
  313. </mo>
  314. <mrow>
  315. <mi>
  316. x
  317. </mi>
  318. <mo>
  319. </mo>
  320. <mi mathvariant="normal">
  321. </mi>
  322. </mrow>
  323. </msub>
  324. </mrow>
  325. <annotation encoding="application/x-tex">
  326. \\limsup_{x \\rightarrow \\infty}
  327. </annotation>
  328. </semantics>
  329. </math>
  330. `;
  331. exports[`A MathML builder should output \\limsup_{x \\rightarrow \\infty} in displaymode correctly 1`] = `
  332. <math>
  333. <semantics>
  334. <mrow>
  335. <munder>
  336. <mo>
  337. <mi mathvariant="normal">
  338. lim&ThinSpace;sup
  339. </mi>
  340. <mo>
  341. </mo>
  342. </mo>
  343. <mrow>
  344. <mi>
  345. x
  346. </mi>
  347. <mo>
  348. </mo>
  349. <mi mathvariant="normal">
  350. </mi>
  351. </mrow>
  352. </munder>
  353. </mrow>
  354. <annotation encoding="application/x-tex">
  355. \\limsup_{x \\rightarrow \\infty}
  356. </annotation>
  357. </semantics>
  358. </math>
  359. `;
  360. exports[`A MathML builder should render boldsymbol with the correct mathvariants 1`] = `
  361. <math>
  362. <semantics>
  363. <mrow>
  364. <mrow>
  365. <mi mathvariant="bold-italic">
  366. A
  367. </mi>
  368. <mi mathvariant="bold-italic">
  369. x
  370. </mi>
  371. <mn mathvariant="bold-italic">
  372. 2
  373. </mn>
  374. <mi mathvariant="bold-italic">
  375. k
  376. </mi>
  377. <mi mathvariant="bold-italic">
  378. ω
  379. </mi>
  380. <mi mathvariant="bold-italic">
  381. Ω
  382. </mi>
  383. <mi mathvariant="bold-italic">
  384. ı
  385. </mi>
  386. <mo mathvariant="bold-italic">
  387. +
  388. </mo>
  389. </mrow>
  390. </mrow>
  391. <annotation encoding="application/x-tex">
  392. \\boldsymbol{Ax2k\\omega\\Omega\\imath+}
  393. </annotation>
  394. </semantics>
  395. </math>
  396. `;
  397. exports[`A MathML builder should render mathchoice as if there was nothing 1`] = `
  398. <math>
  399. <semantics>
  400. <mrow>
  401. <mstyle scriptlevel="0"
  402. displaystyle="true"
  403. >
  404. <mrow>
  405. <munderover>
  406. <mo>
  407. </mo>
  408. <mrow>
  409. <mi>
  410. k
  411. </mi>
  412. <mo>
  413. =
  414. </mo>
  415. <mn>
  416. 0
  417. </mn>
  418. </mrow>
  419. <mi mathvariant="normal">
  420. </mi>
  421. </munderover>
  422. <msup>
  423. <mi>
  424. x
  425. </mi>
  426. <mi>
  427. k
  428. </mi>
  429. </msup>
  430. </mrow>
  431. </mstyle>
  432. </mrow>
  433. <annotation encoding="application/x-tex">
  434. \\displaystyle\\mathchoice{\\sum_{k = 0}^{\\infty} x^k}{T}{S}{SS}
  435. </annotation>
  436. </semantics>
  437. </math>
  438. `;
  439. exports[`A MathML builder should render mathchoice as if there was nothing 2`] = `
  440. <math>
  441. <semantics>
  442. <mrow>
  443. <msubsup>
  444. <mo>
  445. </mo>
  446. <mrow>
  447. <mi>
  448. k
  449. </mi>
  450. <mo>
  451. =
  452. </mo>
  453. <mn>
  454. 0
  455. </mn>
  456. </mrow>
  457. <mi mathvariant="normal">
  458. </mi>
  459. </msubsup>
  460. <msup>
  461. <mi>
  462. x
  463. </mi>
  464. <mi>
  465. k
  466. </mi>
  467. </msup>
  468. </mrow>
  469. <annotation encoding="application/x-tex">
  470. \\mathchoice{D}{\\sum_{k = 0}^{\\infty} x^k}{S}{SS}
  471. </annotation>
  472. </semantics>
  473. </math>
  474. `;
  475. exports[`A MathML builder should render mathchoice as if there was nothing 3`] = `
  476. <math>
  477. <semantics>
  478. <mrow>
  479. <msub>
  480. <mi>
  481. x
  482. </mi>
  483. <mi>
  484. T
  485. </mi>
  486. </msub>
  487. </mrow>
  488. <annotation encoding="application/x-tex">
  489. x_{\\mathchoice{D}{T}{\\sum_{k = 0}^{\\infty} x^k}{SS}}
  490. </annotation>
  491. </semantics>
  492. </math>
  493. `;
  494. exports[`A MathML builder should render mathchoice as if there was nothing 4`] = `
  495. <math>
  496. <semantics>
  497. <mrow>
  498. <msub>
  499. <mi>
  500. x
  501. </mi>
  502. <msub>
  503. <mi>
  504. y
  505. </mi>
  506. <mi>
  507. T
  508. </mi>
  509. </msub>
  510. </msub>
  511. </mrow>
  512. <annotation encoding="application/x-tex">
  513. x_{y_{\\mathchoice{D}{T}{S}{\\sum_{k = 0}^{\\infty} x^k}}}
  514. </annotation>
  515. </semantics>
  516. </math>
  517. `;
  518. exports[`A MathML builder should set href attribute for href appropriately 1`] = `
  519. <math>
  520. <semantics>
  521. <mrow>
  522. <mi href="http://example.org">
  523. α
  524. </mi>
  525. </mrow>
  526. <annotation encoding="application/x-tex">
  527. \\href{http://example.org}{\\alpha}
  528. </annotation>
  529. </semantics>
  530. </math>
  531. `;
  532. exports[`A MathML builder should use <menclose> for colorbox 1`] = `
  533. <math>
  534. <semantics>
  535. <mrow>
  536. <menclose mathbackground="red">
  537. <mtext>
  538. b
  539. </mtext>
  540. </menclose>
  541. </mrow>
  542. <annotation encoding="application/x-tex">
  543. \\colorbox{red}{b}
  544. </annotation>
  545. </semantics>
  546. </math>
  547. `;
  548. exports[`A MathML builder should use <mpadded> for raisebox 1`] = `
  549. <math>
  550. <semantics>
  551. <mrow>
  552. <mpadded voffset="0.25em">
  553. <mtext>
  554. b
  555. </mtext>
  556. </mpadded>
  557. </mrow>
  558. <annotation encoding="application/x-tex">
  559. \\raisebox{0.25em}{b}
  560. </annotation>
  561. </semantics>
  562. </math>
  563. `;
  564. exports[`A MathML builder should use <msupsub> for regular operators 1`] = `
  565. <math>
  566. <semantics>
  567. <mrow>
  568. <mstyle scriptlevel="0"
  569. displaystyle="false"
  570. >
  571. <msubsup>
  572. <mo>
  573. </mo>
  574. <mi>
  575. a
  576. </mi>
  577. <mi>
  578. b
  579. </mi>
  580. </msubsup>
  581. </mstyle>
  582. </mrow>
  583. <annotation encoding="application/x-tex">
  584. \\textstyle\\sum_a^b
  585. </annotation>
  586. </semantics>
  587. </math>
  588. `;
  589. exports[`A MathML builder should use <munderover> for large operators 1`] = `
  590. <math>
  591. <semantics>
  592. <mrow>
  593. <mstyle scriptlevel="0"
  594. displaystyle="true"
  595. >
  596. <munderover>
  597. <mo>
  598. </mo>
  599. <mi>
  600. a
  601. </mi>
  602. <mi>
  603. b
  604. </mi>
  605. </munderover>
  606. </mstyle>
  607. </mrow>
  608. <annotation encoding="application/x-tex">
  609. \\displaystyle\\sum_a^b
  610. </annotation>
  611. </semantics>
  612. </math>
  613. `;
  614. exports[`A MathML builder special spaces render specially 1`] = `
  615. <math>
  616. <semantics>
  617. <mrow>
  618. <mtext>
  619. &ThinSpace;
  620. </mtext>
  621. <mtext>
  622. &ThinSpace;
  623. </mtext>
  624. <mtext>
  625. &MediumSpace;
  626. </mtext>
  627. <mtext>
  628. &MediumSpace;
  629. </mtext>
  630. <mtext>
  631. &MediumSpace;
  632. </mtext>
  633. <mtext>
  634. &ThickSpace;
  635. </mtext>
  636. <mtext>
  637. &ThickSpace;
  638. </mtext>
  639. <mtext>
  640. &NegativeThinSpace;
  641. </mtext>
  642. <mtext>
  643. &NegativeThinSpace;
  644. </mtext>
  645. <mtext>
  646. &NegativeMediumSpace;
  647. </mtext>
  648. <mtext>
  649. &NegativeThickSpace;
  650. </mtext>
  651. <mtext>
  652. &VeryThinSpace;
  653. </mtext>
  654. <mtext>
  655. &ThinSpace;
  656. </mtext>
  657. <mtext>
  658. &MediumSpace;
  659. </mtext>
  660. <mtext>
  661. &ThickSpace;
  662. </mtext>
  663. <mtext>
  664. &NegativeVeryThinSpace;
  665. </mtext>
  666. <mtext>
  667. &NegativeThinSpace;
  668. </mtext>
  669. <mtext>
  670. &NegativeMediumSpace;
  671. </mtext>
  672. <mtext>
  673. &NegativeThickSpace;
  674. </mtext>
  675. </mrow>
  676. <annotation encoding="application/x-tex">
  677. \\,\\thinspace\\:\\&gt;\\medspace\\;\\thickspace\\!\\negthinspace\\negmedspace\\negthickspace\\mkern1mu\\mkern3mu\\mkern4mu\\mkern5mu\\mkern-1mu\\mkern-3mu\\mkern-4mu\\mkern-5mu
  678. </annotation>
  679. </semantics>
  680. </math>
  681. `;
  682. exports[`A MathML builder tags use <mlabeledtr> 1`] = `
  683. <math>
  684. <semantics>
  685. <mtable side="right">
  686. <mlabeledtr>
  687. <mtd>
  688. <mtext>
  689. (hi)
  690. </mtext>
  691. </mtd>
  692. <mtd>
  693. <mrow>
  694. <mi>
  695. x
  696. </mi>
  697. <mo>
  698. +
  699. </mo>
  700. <msup>
  701. <mi>
  702. y
  703. </mi>
  704. <mn>
  705. 2
  706. </mn>
  707. </msup>
  708. </mrow>
  709. </mtd>
  710. </mlabeledtr>
  711. </mtable>
  712. <annotation encoding="application/x-tex">
  713. \\tag{hi} x+y^2
  714. </annotation>
  715. </semantics>
  716. </math>
  717. `;