Skip to content

Commit

Permalink
Patch @docusaurus/theme-common as temp workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim committed Mar 25, 2022
1 parent 51bb149 commit 9ed58c0
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 20 deletions.
4 changes: 3 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
presets: [
require.resolve('@docusaurus/core/lib/babel/preset')
],
};
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"serve": "docusaurus serve",
"clear": "docusaurus clear"
"clear": "docusaurus clear",
"postinstall": "patch-package"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-beta.16",
"@docusaurus/module-type-aliases": "^2.0.0-beta.16",
"@docusaurus/plugin-client-redirects": "^2.0.0-beta.16",
"@docusaurus/preset-classic": "^2.0.0-beta.16",
"@docusaurus/core": "2.0.0-beta.17",
"@docusaurus/module-type-aliases": "2.0.0-beta.17",
"@docusaurus/plugin-client-redirects": "2.0.0-beta.17",
"@docusaurus/preset-classic": "2.0.0-beta.17",
"@mdx-js/react": "^1.6.21",
"amplitude-js": "^8.9.1",
"clsx": "^1.1.1",
Expand All @@ -40,5 +41,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0"
}
}
}
13 changes: 13 additions & 0 deletions patches/@docusaurus+theme-common+2.0.0-beta.17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@docusaurus/theme-common/lib/utils/codeBlockUtils.js b/node_modules/@docusaurus/theme-common/lib/utils/codeBlockUtils.js
index 711d1bf..dfc7c88 100644
--- a/node_modules/@docusaurus/theme-common/lib/utils/codeBlockUtils.js
+++ b/node_modules/@docusaurus/theme-common/lib/utils/codeBlockUtils.js
@@ -6,7 +6,7 @@
*/
import rangeParser from 'parse-numeric-range';
const codeBlockTitleRegex = /title=(?<quote>["'])(?<title>.*?)\1/;
-const highlightLinesRangeRegex = /{(?<range>[\d,-]+)}/;
+const highlightLinesRangeRegex = /\{(?<range>[\d,-]+)\}/;
const commentTypes = ['js', 'jsBlock', 'jsx', 'python', 'html'];
// Supported types of highlight comments
const commentPatterns = {
Loading

0 comments on commit 9ed58c0

Please sign in to comment.