mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:34:00 +01:00
fix math-katex rendering (#194)
* fix math-katex rendering * enable singleDollarTextMath option with remarkMath * dynamic import katex.css and add yarn.lock --------- Co-authored-by: Jing Hua <tohjinghua123@gmail.com>
This commit is contained in:
parent
96bf1c50fb
commit
cc82f5b29d
|
@ -49,6 +49,7 @@
|
||||||
"i18next-browser-languagedetector": "^7.0.1",
|
"i18next-browser-languagedetector": "^7.0.1",
|
||||||
"i18next-http-backend": "^2.1.1",
|
"i18next-http-backend": "^2.1.1",
|
||||||
"jspdf": "^2.5.1",
|
"jspdf": "^2.5.1",
|
||||||
|
"katex": "^0.16.4",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"match-sorter": "^6.3.1",
|
"match-sorter": "^6.3.1",
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
|
|
|
@ -141,7 +141,7 @@ const ContentView = React.memo(
|
||||||
[remarkMath, { singleDollarTextMath: false }],
|
[remarkMath, { singleDollarTextMath: false }],
|
||||||
]}
|
]}
|
||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
[rehypeKatex, { output: 'mathml' }],
|
rehypeKatex,
|
||||||
[
|
[
|
||||||
rehypeHighlight,
|
rehypeHighlight,
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import './main.css';
|
import './main.css';
|
||||||
|
await import('katex/dist/katex.min.css');
|
||||||
|
|
||||||
import './i18n';
|
import './i18n';
|
||||||
|
|
||||||
|
|
|
@ -2314,6 +2314,13 @@ katex@^0.15.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
commander "^8.0.0"
|
commander "^8.0.0"
|
||||||
|
|
||||||
|
katex@^0.16.4:
|
||||||
|
version "0.16.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.4.tgz#87021bc3bbd80586ef715aeb476794cba6a49ad4"
|
||||||
|
integrity sha512-WudRKUj8yyBeVDI4aYMNxhx5Vhh2PjpzQw1GRu/LVGqL4m1AxwD1GcUp0IMbdJaf5zsjtj8ghP0DOQRYhroNkw==
|
||||||
|
dependencies:
|
||||||
|
commander "^8.0.0"
|
||||||
|
|
||||||
keyv@^4.0.0:
|
keyv@^4.0.0:
|
||||||
version "4.5.2"
|
version "4.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56"
|
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56"
|
||||||
|
|
Loading…
Reference in a new issue