Skip to content

Commit

Permalink
fix(theme): upgrade prism-react-renderer, fix html script and style t…
Browse files Browse the repository at this point in the history
…ag highlighting (#9567)
  • Loading branch information
slorber authored Nov 21, 2023
1 parent 424ffd2 commit 58f59e7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@docusaurus/preset-classic": "3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0",
"prism-react-renderer": "^2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-docusaurus/templates/classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@docusaurus/preset-classic": "3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0",
"prism-react-renderer": "^2.2.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"postcss": "^8.4.26",
"prism-react-renderer": "^2.1.0",
"prism-react-renderer": "^2.2.0",
"prismjs": "^1.29.0",
"react-router-dom": "^5.3.4",
"rtlcss": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@types/react-router-config": "*",
"clsx": "^1.2.1",
"parse-numeric-range": "^1.3.0",
"prism-react-renderer": "^2.1.0",
"prism-react-renderer": "^2.2.0",
"tslib": "^2.6.0",
"utility-types": "^3.10.0"
},
Expand Down
20 changes: 20 additions & 0 deletions website/_dogfooding/_pages tests/code-block-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,23 @@ y = times2(x);
% highlight-end
\end{document}
```

## HTML - script + style highlighting

See https://github.com/facebook/docusaurus/issues/9517

```html
<html lang="en">
<head>
<script>
const name = 'Formidable';
console.log(name);
</script>
<style>
.some-class {
border: solid red thick;
}
</style>
</head>
</html>
```
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13467,10 +13467,10 @@ pretty-time@^1.1.0:
resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e"
integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==

prism-react-renderer@^2.0.6, prism-react-renderer@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-2.1.0.tgz#a2f418451647412ea73d18cfe363fea20e419f9d"
integrity sha512-I5cvXHjA1PVGbGm1MsWCpvBCRrYyxEri0MC7/JbfIfYfcXAxHyO5PaUjs3A8H5GW6kJcLhTHxxMaOZZpRZD2iQ==
prism-react-renderer@^2.0.6, prism-react-renderer@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-2.2.0.tgz#f199b15716e0b8d0ccfd1986ff6fa226fb7ff2b1"
integrity sha512-j4AN0VkEr72598+47xDvpzeYyeh/wPPRNTt9nJFZqIZUxwGKwYqYgt7RVigZ3ZICJWJWN84KEuMKPNyypyhNIw==
dependencies:
"@types/prismjs" "^1.26.0"
clsx "^1.2.1"
Expand Down

0 comments on commit 58f59e7

Please sign in to comment.