Skip to content

Commit

Permalink
feat: ✨ add rehype-highlight support to Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jan 3, 2025
1 parent 94b5b32 commit 5baae5d
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 168 deletions.
42 changes: 21 additions & 21 deletions THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1954,25 +1954,25 @@ Apache License

The following npm packages may be included in this product:

- @aws-sdk/client-cognito-identity@3.716.0
- @aws-sdk/client-sso-oidc@3.716.0
- @aws-sdk/client-sso@3.716.0
- @aws-sdk/client-sts@3.716.0
- @aws-sdk/credential-provider-cognito-identity@3.716.0
- @aws-sdk/client-cognito-identity@3.721.0
- @aws-sdk/client-sso-oidc@3.721.0
- @aws-sdk/client-sso@3.721.0
- @aws-sdk/client-sts@3.721.0
- @aws-sdk/credential-provider-cognito-identity@3.721.0
- @aws-sdk/util-user-agent-browser@3.714.0
- @aws-sdk/util-user-agent-node@3.716.0
- @aws-sdk/util-user-agent-node@3.721.0
- @smithy/eventstream-codec@2.2.0
- @smithy/eventstream-codec@3.1.10
- @smithy/middleware-retry@3.0.33
- @smithy/middleware-retry@3.0.34
- @smithy/querystring-builder@2.2.0
- @smithy/querystring-builder@3.0.11
- @smithy/querystring-parser@2.2.0
- @smithy/querystring-parser@3.0.11
- @smithy/service-error-classification@3.0.11
- @smithy/url-parser@2.2.0
- @smithy/url-parser@3.0.11
- @smithy/util-defaults-mode-browser@3.0.33
- @smithy/util-defaults-mode-node@3.0.33
- @smithy/util-defaults-mode-browser@3.0.34
- @smithy/util-defaults-mode-node@3.0.34

These packages each contain the following license:

Expand Down Expand Up @@ -2182,7 +2182,7 @@ Apache License

The following npm package may be included in this product:

- @aws-sdk/client-bedrock-runtime@3.716.0
- @aws-sdk/client-bedrock-runtime@3.721.0

This package contains the following license:

Expand Down Expand Up @@ -2394,8 +2394,8 @@ The following npm packages may be included in this product:

- @aws-sdk/middleware-host-header@3.714.0
- @aws-sdk/middleware-recursion-detection@3.714.0
- @aws-sdk/middleware-user-agent@3.716.0
- @smithy/core@2.5.6
- @aws-sdk/middleware-user-agent@3.721.0
- @smithy/core@2.5.7
- @smithy/eventstream-serde-browser@3.0.14
- @smithy/eventstream-serde-config-resolver@3.0.11
- @smithy/eventstream-serde-node@2.2.0
Expand All @@ -2408,7 +2408,7 @@ The following npm packages may be included in this product:
- @smithy/protocol-http@3.3.0
- @smithy/protocol-http@4.1.8
- @smithy/smithy-client@2.5.1
- @smithy/smithy-client@3.6.0
- @smithy/smithy-client@3.7.0
- @smithy/types@2.12.0
- @smithy/types@3.7.2

Expand Down Expand Up @@ -4162,11 +4162,11 @@ Apache License
The following npm packages may be included in this product:

- @aws-sdk/credential-provider-env@3.716.0
- @aws-sdk/credential-provider-ini@3.716.0
- @aws-sdk/credential-provider-node@3.716.0
- @aws-sdk/credential-providers@3.716.0
- @aws-sdk/credential-provider-ini@3.721.0
- @aws-sdk/credential-provider-node@3.721.0
- @aws-sdk/credential-providers@3.721.0
- @aws-sdk/region-config-resolver@3.714.0
- @aws-sdk/token-providers@3.714.0
- @aws-sdk/token-providers@3.721.0
- @aws-sdk/types@3.714.0
- @aws-sdk/util-endpoints@3.714.0
- @aws-sdk/util-locate-window@3.693.0
Expand All @@ -4176,13 +4176,13 @@ The following npm packages may be included in this product:
- @smithy/config-resolver@3.0.13
- @smithy/credential-provider-imds@3.2.8
- @smithy/fetch-http-handler@2.5.0
- @smithy/fetch-http-handler@4.1.2
- @smithy/fetch-http-handler@4.1.3
- @smithy/hash-node@3.0.11
- @smithy/is-array-buffer@2.2.0
- @smithy/is-array-buffer@3.0.0
- @smithy/middleware-content-length@3.0.13
- @smithy/middleware-endpoint@2.5.1
- @smithy/middleware-endpoint@3.2.7
- @smithy/middleware-endpoint@3.2.8
- @smithy/middleware-stack@2.2.0
- @smithy/middleware-stack@3.0.11
- @smithy/node-http-handler@2.5.0
Expand All @@ -4202,7 +4202,7 @@ The following npm packages may be included in this product:
- @smithy/util-hex-encoding@2.2.0
- @smithy/util-hex-encoding@3.0.0
- @smithy/util-stream@2.2.0
- @smithy/util-stream@3.3.3
- @smithy/util-stream@3.3.4
- @smithy/util-uri-escape@2.2.0
- @smithy/util-uri-escape@3.0.0
- @smithy/util-utf8@2.3.0
Expand Down Expand Up @@ -4417,7 +4417,7 @@ Apache License
The following npm packages may be included in this product:

- @aws-sdk/credential-provider-process@3.716.0
- @aws-sdk/credential-provider-sso@3.716.0
- @aws-sdk/credential-provider-sso@3.721.0
- @aws-sdk/credential-provider-web-identity@3.716.0

These packages each contain the following license:
Expand Down
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4881,9 +4881,9 @@ vfile@^6.0.0, vfile@^6.0.2, vfile@^6.0.3:
vfile-message "^4.0.0"

vite@^6.0.5:
version "6.0.6"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.6.tgz#a851674fcff55b0c1962f72082354b8802e48505"
integrity sha512-NSjmUuckPmDU18bHz7QZ+bTYhRR0iA72cs2QAxCqDpafJ0S6qetco0LB3WW2OxlMHS0JmAv+yZ/R3uPmMyGTjQ==
version "6.0.7"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.7.tgz#f0f8c120733b04af52b4a1e3e7cb54eb851a799b"
integrity sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==
dependencies:
esbuild "^0.24.2"
postcss "^8.4.49"
Expand Down
1 change: 1 addition & 0 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react-dom": "^19.0.0",
"react-error-boundary": "^5.0.0",
"react-markdown": "^9.0.1",
"rehype-highlight": "^7.0.1",
"rehype-mermaid": "^3.0.0",
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/web/src/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { remarkAlert } from "remark-github-blockquote-alert"
import remarkMath from "remark-math"
import rehypeMathML from "@daiji256/rehype-mathml"
import { ErrorBoundary } from "react-error-boundary"
import rehypeHighlight from "rehype-highlight"

export default function Markdown(props: { className?: string; children: any }) {
const { className, children } = props
Expand All @@ -20,6 +21,7 @@ export default function Markdown(props: { className?: string; children: any }) {
rehypeRaw,
rehypeMathML,
rehypeSanitize,
rehypeHighlight,
]}
remarkPlugins={[remarkMath, remarkGfm, remarkAlert]}
>
Expand Down
6 changes: 3 additions & 3 deletions slides/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5244,9 +5244,9 @@ vite-plugin-vue-server-ref@^0.4.2:
ufo "^1.3.2"

vite@^6.0.3:
version "6.0.6"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.6.tgz#a851674fcff55b0c1962f72082354b8802e48505"
integrity sha512-NSjmUuckPmDU18bHz7QZ+bTYhRR0iA72cs2QAxCqDpafJ0S6qetco0LB3WW2OxlMHS0JmAv+yZ/R3uPmMyGTjQ==
version "6.0.7"
resolved "https://registry.yarnpkg.com/vite/-/vite-6.0.7.tgz#f0f8c120733b04af52b4a1e3e7cb54eb851a799b"
integrity sha512-RDt8r/7qx9940f8FcOIAH9PTViRrghKaK2K1jY3RaAURrEUbm9Du1mJ72G+jlhtG3WwodnfzY8ORQZbBavZEAQ==
dependencies:
esbuild "^0.24.2"
postcss "^8.4.49"
Expand Down
Loading

0 comments on commit 5baae5d

Please sign in to comment.