umanggarg Claude Sonnet 4.6 commited on
Commit
c264b79
·
1 Parent(s): 8f7df39

Add KaTeX math rendering via remark-math + rehype-katex

Browse files

$...$ and $$...$$ LaTeX expressions were rendering as raw text.
Added remark-math to parse math nodes and rehype-katex to render
them as proper equations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

ui/package-lock.json CHANGED
@@ -14,7 +14,9 @@
14
  "react-dom": "^19.2.4",
15
  "react-markdown": "^10.1.0",
16
  "react-syntax-highlighter": "^16.1.1",
17
- "remark-gfm": "^4.0.1"
 
 
18
  },
19
  "devDependencies": {
20
  "@eslint/js": "^9.39.4",
@@ -1624,6 +1626,11 @@
1624
  "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
1625
  "dev": true
1626
  },
 
 
 
 
 
1627
  "node_modules/@types/mdast": {
1628
  "version": "4.0.4",
1629
  "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
@@ -2567,6 +2574,17 @@
2567
  "integrity": "sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==",
2568
  "dev": true
2569
  },
 
 
 
 
 
 
 
 
 
 
 
2570
  "node_modules/esbuild": {
2571
  "version": "0.21.5",
2572
  "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
@@ -2960,6 +2978,83 @@
2960
  "node": ">=8"
2961
  }
2962
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2963
  "node_modules/hast-util-parse-selector": {
2964
  "version": "4.0.0",
2965
  "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
@@ -2998,6 +3093,21 @@
2998
  "url": "https://opencollective.com/unified"
2999
  }
3000
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3001
  "node_modules/hast-util-whitespace": {
3002
  "version": "3.0.0",
3003
  "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
@@ -3551,6 +3661,24 @@
3551
  "url": "https://opencollective.com/unified"
3552
  }
3553
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3554
  "node_modules/mdast-util-mdx-expression": {
3555
  "version": "2.0.1",
3556
  "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",
@@ -3882,6 +4010,24 @@
3882
  "url": "https://opencollective.com/unified"
3883
  }
3884
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3885
  "node_modules/micromark-factory-destination": {
3886
  "version": "2.0.1",
3887
  "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
@@ -4381,6 +4527,17 @@
4381
  "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
4382
  "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="
4383
  },
 
 
 
 
 
 
 
 
 
 
 
4384
  "node_modules/path-data-parser": {
4385
  "version": "0.1.0",
4386
  "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
@@ -4590,6 +4747,24 @@
4590
  "url": "https://github.com/sponsors/wooorm"
4591
  }
4592
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4593
  "node_modules/remark-gfm": {
4594
  "version": "4.0.1",
4595
  "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",
@@ -4607,6 +4782,21 @@
4607
  "url": "https://opencollective.com/unified"
4608
  }
4609
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4610
  "node_modules/remark-parse": {
4611
  "version": "11.0.0",
4612
  "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
@@ -4911,6 +5101,19 @@
4911
  "url": "https://opencollective.com/unified"
4912
  }
4913
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
4914
  "node_modules/unist-util-is": {
4915
  "version": "6.0.1",
4916
  "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
@@ -4935,6 +5138,19 @@
4935
  "url": "https://opencollective.com/unified"
4936
  }
4937
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
4938
  "node_modules/unist-util-stringify-position": {
4939
  "version": "4.0.0",
4940
  "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
@@ -5038,6 +5254,19 @@
5038
  "url": "https://opencollective.com/unified"
5039
  }
5040
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
5041
  "node_modules/vfile-message": {
5042
  "version": "4.0.3",
5043
  "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
@@ -5153,6 +5382,15 @@
5153
  "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz",
5154
  "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="
5155
  },
 
 
 
 
 
 
 
 
 
5156
  "node_modules/which": {
5157
  "version": "2.0.2",
5158
  "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
 
14
  "react-dom": "^19.2.4",
15
  "react-markdown": "^10.1.0",
16
  "react-syntax-highlighter": "^16.1.1",
17
+ "rehype-katex": "^7.0.1",
18
+ "remark-gfm": "^4.0.1",
19
+ "remark-math": "^6.0.0"
20
  },
21
  "devDependencies": {
22
  "@eslint/js": "^9.39.4",
 
1626
  "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
1627
  "dev": true
1628
  },
1629
+ "node_modules/@types/katex": {
1630
+ "version": "0.16.8",
1631
+ "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.8.tgz",
1632
+ "integrity": "sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg=="
1633
+ },
1634
  "node_modules/@types/mdast": {
1635
  "version": "4.0.4",
1636
  "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
 
2574
  "integrity": "sha512-IbxXrsTlD3hRodkLnbxAPP4OuJYdWCeM3IOdT+CpcMoIwIoDfCmRpEtSPfwBXxVkg9xmBeY7Lz2Eo2TDn/HC3Q==",
2575
  "dev": true
2576
  },
2577
+ "node_modules/entities": {
2578
+ "version": "6.0.1",
2579
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
2580
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
2581
+ "engines": {
2582
+ "node": ">=0.12"
2583
+ },
2584
+ "funding": {
2585
+ "url": "https://github.com/fb55/entities?sponsor=1"
2586
+ }
2587
+ },
2588
  "node_modules/esbuild": {
2589
  "version": "0.21.5",
2590
  "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
 
2978
  "node": ">=8"
2979
  }
2980
  },
2981
+ "node_modules/hast-util-from-dom": {
2982
+ "version": "5.0.1",
2983
+ "resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-5.0.1.tgz",
2984
+ "integrity": "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q==",
2985
+ "dependencies": {
2986
+ "@types/hast": "^3.0.0",
2987
+ "hastscript": "^9.0.0",
2988
+ "web-namespaces": "^2.0.0"
2989
+ },
2990
+ "funding": {
2991
+ "type": "opencollective",
2992
+ "url": "https://opencollective.com/unified"
2993
+ }
2994
+ },
2995
+ "node_modules/hast-util-from-html": {
2996
+ "version": "2.0.3",
2997
+ "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz",
2998
+ "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==",
2999
+ "dependencies": {
3000
+ "@types/hast": "^3.0.0",
3001
+ "devlop": "^1.1.0",
3002
+ "hast-util-from-parse5": "^8.0.0",
3003
+ "parse5": "^7.0.0",
3004
+ "vfile": "^6.0.0",
3005
+ "vfile-message": "^4.0.0"
3006
+ },
3007
+ "funding": {
3008
+ "type": "opencollective",
3009
+ "url": "https://opencollective.com/unified"
3010
+ }
3011
+ },
3012
+ "node_modules/hast-util-from-html-isomorphic": {
3013
+ "version": "2.0.0",
3014
+ "resolved": "https://registry.npmjs.org/hast-util-from-html-isomorphic/-/hast-util-from-html-isomorphic-2.0.0.tgz",
3015
+ "integrity": "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw==",
3016
+ "dependencies": {
3017
+ "@types/hast": "^3.0.0",
3018
+ "hast-util-from-dom": "^5.0.0",
3019
+ "hast-util-from-html": "^2.0.0",
3020
+ "unist-util-remove-position": "^5.0.0"
3021
+ },
3022
+ "funding": {
3023
+ "type": "opencollective",
3024
+ "url": "https://opencollective.com/unified"
3025
+ }
3026
+ },
3027
+ "node_modules/hast-util-from-parse5": {
3028
+ "version": "8.0.3",
3029
+ "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
3030
+ "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==",
3031
+ "dependencies": {
3032
+ "@types/hast": "^3.0.0",
3033
+ "@types/unist": "^3.0.0",
3034
+ "devlop": "^1.0.0",
3035
+ "hastscript": "^9.0.0",
3036
+ "property-information": "^7.0.0",
3037
+ "vfile": "^6.0.0",
3038
+ "vfile-location": "^5.0.0",
3039
+ "web-namespaces": "^2.0.0"
3040
+ },
3041
+ "funding": {
3042
+ "type": "opencollective",
3043
+ "url": "https://opencollective.com/unified"
3044
+ }
3045
+ },
3046
+ "node_modules/hast-util-is-element": {
3047
+ "version": "3.0.0",
3048
+ "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz",
3049
+ "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==",
3050
+ "dependencies": {
3051
+ "@types/hast": "^3.0.0"
3052
+ },
3053
+ "funding": {
3054
+ "type": "opencollective",
3055
+ "url": "https://opencollective.com/unified"
3056
+ }
3057
+ },
3058
  "node_modules/hast-util-parse-selector": {
3059
  "version": "4.0.0",
3060
  "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
 
3093
  "url": "https://opencollective.com/unified"
3094
  }
3095
  },
3096
+ "node_modules/hast-util-to-text": {
3097
+ "version": "4.0.2",
3098
+ "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz",
3099
+ "integrity": "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==",
3100
+ "dependencies": {
3101
+ "@types/hast": "^3.0.0",
3102
+ "@types/unist": "^3.0.0",
3103
+ "hast-util-is-element": "^3.0.0",
3104
+ "unist-util-find-after": "^5.0.0"
3105
+ },
3106
+ "funding": {
3107
+ "type": "opencollective",
3108
+ "url": "https://opencollective.com/unified"
3109
+ }
3110
+ },
3111
  "node_modules/hast-util-whitespace": {
3112
  "version": "3.0.0",
3113
  "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
 
3661
  "url": "https://opencollective.com/unified"
3662
  }
3663
  },
3664
+ "node_modules/mdast-util-math": {
3665
+ "version": "3.0.0",
3666
+ "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz",
3667
+ "integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==",
3668
+ "dependencies": {
3669
+ "@types/hast": "^3.0.0",
3670
+ "@types/mdast": "^4.0.0",
3671
+ "devlop": "^1.0.0",
3672
+ "longest-streak": "^3.0.0",
3673
+ "mdast-util-from-markdown": "^2.0.0",
3674
+ "mdast-util-to-markdown": "^2.1.0",
3675
+ "unist-util-remove-position": "^5.0.0"
3676
+ },
3677
+ "funding": {
3678
+ "type": "opencollective",
3679
+ "url": "https://opencollective.com/unified"
3680
+ }
3681
+ },
3682
  "node_modules/mdast-util-mdx-expression": {
3683
  "version": "2.0.1",
3684
  "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz",
 
4010
  "url": "https://opencollective.com/unified"
4011
  }
4012
  },
4013
+ "node_modules/micromark-extension-math": {
4014
+ "version": "3.1.0",
4015
+ "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz",
4016
+ "integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==",
4017
+ "dependencies": {
4018
+ "@types/katex": "^0.16.0",
4019
+ "devlop": "^1.0.0",
4020
+ "katex": "^0.16.0",
4021
+ "micromark-factory-space": "^2.0.0",
4022
+ "micromark-util-character": "^2.0.0",
4023
+ "micromark-util-symbol": "^2.0.0",
4024
+ "micromark-util-types": "^2.0.0"
4025
+ },
4026
+ "funding": {
4027
+ "type": "opencollective",
4028
+ "url": "https://opencollective.com/unified"
4029
+ }
4030
+ },
4031
  "node_modules/micromark-factory-destination": {
4032
  "version": "2.0.1",
4033
  "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
 
4527
  "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz",
4528
  "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="
4529
  },
4530
+ "node_modules/parse5": {
4531
+ "version": "7.3.0",
4532
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
4533
+ "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
4534
+ "dependencies": {
4535
+ "entities": "^6.0.0"
4536
+ },
4537
+ "funding": {
4538
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
4539
+ }
4540
+ },
4541
  "node_modules/path-data-parser": {
4542
  "version": "0.1.0",
4543
  "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz",
 
4747
  "url": "https://github.com/sponsors/wooorm"
4748
  }
4749
  },
4750
+ "node_modules/rehype-katex": {
4751
+ "version": "7.0.1",
4752
+ "resolved": "https://registry.npmjs.org/rehype-katex/-/rehype-katex-7.0.1.tgz",
4753
+ "integrity": "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==",
4754
+ "dependencies": {
4755
+ "@types/hast": "^3.0.0",
4756
+ "@types/katex": "^0.16.0",
4757
+ "hast-util-from-html-isomorphic": "^2.0.0",
4758
+ "hast-util-to-text": "^4.0.0",
4759
+ "katex": "^0.16.0",
4760
+ "unist-util-visit-parents": "^6.0.0",
4761
+ "vfile": "^6.0.0"
4762
+ },
4763
+ "funding": {
4764
+ "type": "opencollective",
4765
+ "url": "https://opencollective.com/unified"
4766
+ }
4767
+ },
4768
  "node_modules/remark-gfm": {
4769
  "version": "4.0.1",
4770
  "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",
 
4782
  "url": "https://opencollective.com/unified"
4783
  }
4784
  },
4785
+ "node_modules/remark-math": {
4786
+ "version": "6.0.0",
4787
+ "resolved": "https://registry.npmjs.org/remark-math/-/remark-math-6.0.0.tgz",
4788
+ "integrity": "sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==",
4789
+ "dependencies": {
4790
+ "@types/mdast": "^4.0.0",
4791
+ "mdast-util-math": "^3.0.0",
4792
+ "micromark-extension-math": "^3.0.0",
4793
+ "unified": "^11.0.0"
4794
+ },
4795
+ "funding": {
4796
+ "type": "opencollective",
4797
+ "url": "https://opencollective.com/unified"
4798
+ }
4799
+ },
4800
  "node_modules/remark-parse": {
4801
  "version": "11.0.0",
4802
  "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
 
5101
  "url": "https://opencollective.com/unified"
5102
  }
5103
  },
5104
+ "node_modules/unist-util-find-after": {
5105
+ "version": "5.0.0",
5106
+ "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz",
5107
+ "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==",
5108
+ "dependencies": {
5109
+ "@types/unist": "^3.0.0",
5110
+ "unist-util-is": "^6.0.0"
5111
+ },
5112
+ "funding": {
5113
+ "type": "opencollective",
5114
+ "url": "https://opencollective.com/unified"
5115
+ }
5116
+ },
5117
  "node_modules/unist-util-is": {
5118
  "version": "6.0.1",
5119
  "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
 
5138
  "url": "https://opencollective.com/unified"
5139
  }
5140
  },
5141
+ "node_modules/unist-util-remove-position": {
5142
+ "version": "5.0.0",
5143
+ "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz",
5144
+ "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==",
5145
+ "dependencies": {
5146
+ "@types/unist": "^3.0.0",
5147
+ "unist-util-visit": "^5.0.0"
5148
+ },
5149
+ "funding": {
5150
+ "type": "opencollective",
5151
+ "url": "https://opencollective.com/unified"
5152
+ }
5153
+ },
5154
  "node_modules/unist-util-stringify-position": {
5155
  "version": "4.0.0",
5156
  "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
 
5254
  "url": "https://opencollective.com/unified"
5255
  }
5256
  },
5257
+ "node_modules/vfile-location": {
5258
+ "version": "5.0.3",
5259
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz",
5260
+ "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==",
5261
+ "dependencies": {
5262
+ "@types/unist": "^3.0.0",
5263
+ "vfile": "^6.0.0"
5264
+ },
5265
+ "funding": {
5266
+ "type": "opencollective",
5267
+ "url": "https://opencollective.com/unified"
5268
+ }
5269
+ },
5270
  "node_modules/vfile-message": {
5271
  "version": "4.0.3",
5272
  "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
 
5382
  "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz",
5383
  "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="
5384
  },
5385
+ "node_modules/web-namespaces": {
5386
+ "version": "2.0.1",
5387
+ "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
5388
+ "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
5389
+ "funding": {
5390
+ "type": "github",
5391
+ "url": "https://github.com/sponsors/wooorm"
5392
+ }
5393
+ },
5394
  "node_modules/which": {
5395
  "version": "2.0.2",
5396
  "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
ui/package.json CHANGED
@@ -16,7 +16,9 @@
16
  "react-dom": "^19.2.4",
17
  "react-markdown": "^10.1.0",
18
  "react-syntax-highlighter": "^16.1.1",
19
- "remark-gfm": "^4.0.1"
 
 
20
  },
21
  "devDependencies": {
22
  "@eslint/js": "^9.39.4",
 
16
  "react-dom": "^19.2.4",
17
  "react-markdown": "^10.1.0",
18
  "react-syntax-highlighter": "^16.1.1",
19
+ "rehype-katex": "^7.0.1",
20
+ "remark-gfm": "^4.0.1",
21
+ "remark-math": "^6.0.0"
22
  },
23
  "devDependencies": {
24
  "@eslint/js": "^9.39.4",
ui/src/components/Message.jsx CHANGED
@@ -1,6 +1,9 @@
1
  import { useState, useCallback, Suspense, lazy, forwardRef } from "react";
2
  import ReactMarkdown from "react-markdown";
3
  import remarkGfm from "remark-gfm";
 
 
 
4
  import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
5
  import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
6
  import SourceCard from "./SourceCard";
@@ -399,7 +402,7 @@ const Message = forwardRef(function Message({ msg, onDiagramThis, onRetry, showR
399
 
400
  {/* Answer bubble */}
401
  <div className="bubble" style={{ position: "relative", display: msg.rateLimited ? "none" : undefined }}>
402
- <ReactMarkdown components={mdComponents} remarkPlugins={[remarkGfm]}>
403
  {msg.content || " "}
404
  </ReactMarkdown>
405
  {/* Show cursor whenever streaming, not just when no tool active */}
 
1
  import { useState, useCallback, Suspense, lazy, forwardRef } from "react";
2
  import ReactMarkdown from "react-markdown";
3
  import remarkGfm from "remark-gfm";
4
+ import remarkMath from "remark-math";
5
+ import rehypeKatex from "rehype-katex";
6
+ import "katex/dist/katex.min.css";
7
  import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
8
  import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
9
  import SourceCard from "./SourceCard";
 
402
 
403
  {/* Answer bubble */}
404
  <div className="bubble" style={{ position: "relative", display: msg.rateLimited ? "none" : undefined }}>
405
+ <ReactMarkdown components={mdComponents} remarkPlugins={[remarkGfm, remarkMath]} rehypePlugins={[rehypeKatex]}>
406
  {msg.content || " "}
407
  </ReactMarkdown>
408
  {/* Show cursor whenever streaming, not just when no tool active */}