From e4f9ab072cb1d44da6af2f27428d9336d9ab587a Mon Sep 17 00:00:00 2001 From: Pranab Das <31024886+pranabdas@users.noreply.github.com> Date: Thu, 23 Dec 2021 14:24:56 +0800 Subject: [PATCH] chore: upgrade rehype-katex and katex stylesheet for website (#6172) * chore: Update rehype-katex and katex stylesheet for doc website * Reformat Co-authored-by: Joshua Chen --- .../markdown-features-math-equations.mdx | 19 ++++++++------- website/docusaurus.config.js | 5 ++-- website/package.json | 2 +- yarn.lock | 24 +++++++++---------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx index b37917b4f2..af17a3b914 100644 --- a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx +++ b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx @@ -42,7 +42,7 @@ $$ To enable KaTeX, you need to install `remark-math` and `rehype-katex` plugins. ```bash npm2yarn -npm install --save remark-math@3 rehype-katex@4 hast-util-is-element@1.1.0 +npm install --save remark-math@3 rehype-katex@5 hast-util-is-element@1.1.0 ``` :::caution @@ -69,11 +69,13 @@ Include the KaTeX CSS in your config under `stylesheets`: ```js stylesheets: [ - { - href: "https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css", - integrity: "sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc", - crossorigin: "anonymous", - }, + { + href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', + type: 'text/css', + integrity: + 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', + crossorigin: 'anonymous', + }, ], ``` @@ -105,9 +107,10 @@ module.exports = { // highlight-start stylesheets: [ { - href: 'https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css', + href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', + type: 'text/css', integrity: - 'sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc', + 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', crossorigin: 'anonymous', }, ], diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 4c1279be27..e275ed55d5 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -79,9 +79,10 @@ const config = { trailingSlash: isDeployPreview, stylesheets: [ { - href: 'https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css', + href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', + type: 'text/css', integrity: - 'sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc', + 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', crossorigin: 'anonymous', }, ], diff --git a/website/package.json b/website/package.json index f6791d3e3e..229ab97443 100644 --- a/website/package.json +++ b/website/package.json @@ -49,7 +49,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "react-popper": "^2.2.5", - "rehype-katex": "^4.0.0", + "rehype-katex": "^5.0.0", "remark-math": "^3.0.1", "workbox-routing": "^5.0.0", "workbox-strategies": "^5.0.0" diff --git a/yarn.lock b/yarn.lock index 8ed13a014b..a8b473e9ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6633,7 +6633,7 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== -commander@^2.19.0, commander@^2.20.0, commander@^2.20.3, commander@^2.3.0, commander@^2.8.1: +commander@^2.20.0, commander@^2.20.3, commander@^2.3.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -6663,7 +6663,7 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -commander@^8.1.0: +commander@^8.0.0, commander@^8.1.0: version "8.3.0" resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== @@ -12036,12 +12036,12 @@ jwt-decode@^3.0.0: resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.1.2.tgz#3fb319f3675a2df0c2895c8f5e9fa4b67b04ed59" integrity sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A== -katex@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.12.0.tgz#2fb1c665dbd2b043edcf8a1f5c555f46beaa0cb9" - integrity sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg== +katex@^0.13.0: + version "0.13.24" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.13.24.tgz#fe55455eb455698cb24b911a353d16a3c855d905" + integrity sha512-jZxYuKCma3VS5UuxOx/rFV1QyGSl3Uy/i0kTJF3HgQ5xMinCQVF8Zd4bMY/9aI9b9A2pjIBOsjSSm68ykTAr8w== dependencies: - commander "^2.19.0" + commander "^8.0.0" kebab-case@^1.0.0: version "1.0.1" @@ -16340,14 +16340,14 @@ regjsparser@^0.7.0: dependencies: jsesc "~0.5.0" -rehype-katex@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/rehype-katex/-/rehype-katex-4.0.0.tgz#ce11a5db0bff014350e7a9cfd30147d314b14330" - integrity sha512-0mgBqYugQyIW0eUl6RDOZ28Cat2YzrnWGaYgKCMQnJw6ClmKgLqXBnkDAPGh2mwxvkkKwQOUMUpSLpA5rt7rzA== +rehype-katex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/rehype-katex/-/rehype-katex-5.0.0.tgz#b556f24fde918f28ba1cb642ea71c7e82f3373d7" + integrity sha512-ksSuEKCql/IiIadOHiKRMjypva9BLhuwQNascMqaoGLDVd0k2NlE2wMvgZ3rpItzRKCd6vs8s7MFbb8pcR0AEg== dependencies: "@types/katex" "^0.11.0" hast-util-to-text "^2.0.0" - katex "^0.12.0" + katex "^0.13.0" rehype-parse "^7.0.0" unified "^9.0.0" unist-util-visit "^2.0.0"