mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 00:17:14 +02:00
chore(v2): fix code style (revert previous changes)
This commit is contained in:
parent
1480a7eb80
commit
1f00d15c74
143 changed files with 457 additions and 458 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