mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 00:09:48 +02:00
chore(v2): upgrade devDependencies (#2538)
* chore(v2): upgrade devDependencies * chore(v2): upgrade devDependencies * chore: prettier
This commit is contained in:
parent
ea8c916528
commit
b07507c9cc
148 changed files with 2385 additions and 1975 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function() {
|
||||
module.exports = function () {
|
||||
return {
|
||||
name: 'docusaurus-theme-live-codeblock',
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ const getHighlightDirectiveRegex = (
|
|||
// to be more reliable, the opening and closing comment must match
|
||||
const commentPattern = languages
|
||||
.map(
|
||||
lang =>
|
||||
(lang) =>
|
||||
`(?:${comments[lang].start}\\s*(${directives})\\s*${comments[lang].end})`,
|
||||
)
|
||||
.join('|');
|
||||
|
@ -63,7 +63,7 @@ const getHighlightDirectiveRegex = (
|
|||
return new RegExp(`^\\s*(?:${commentPattern})\\s*$`);
|
||||
};
|
||||
// select comment styles based on language
|
||||
const highlightDirectiveRegex = lang => {
|
||||
const highlightDirectiveRegex = (lang) => {
|
||||
switch (lang) {
|
||||
case 'js':
|
||||
case 'javascript':
|
||||
|
@ -127,7 +127,9 @@ export default ({
|
|||
|
||||
if (metastring && highlightLinesRangeRegex.test(metastring)) {
|
||||
const highlightLinesRange = metastring.match(highlightLinesRangeRegex)[1];
|
||||
highlightLines = rangeParser.parse(highlightLinesRange).filter(n => n > 0);
|
||||
highlightLines = rangeParser
|
||||
.parse(highlightLinesRange)
|
||||
.filter((n) => n > 0);
|
||||
}
|
||||
|
||||
if (metastring && codeBlockTitleRegex.test(metastring)) {
|
||||
|
|
|
@ -15,7 +15,7 @@ function Playground({children, theme, transformCode, ...props}) {
|
|||
return (
|
||||
<LiveProvider
|
||||
code={children}
|
||||
transformCode={transformCode || (code => `${code};`)}
|
||||
transformCode={transformCode || ((code) => `${code};`)}
|
||||
theme={theme}
|
||||
{...props}>
|
||||
<div
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue