mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-01 16:00:29 +02:00
Prettify all JavaScript files (#964)
* Prettify all JavaScript files * Make trailingComma all * Delete v2/.prettierignore * Remove v2 Prettier commands in package.json
This commit is contained in:
parent
a1de6dab04
commit
9d4a5d5359
101 changed files with 441 additions and 473 deletions
|
@ -12,7 +12,7 @@ class MarkdownBlock extends React.Component {
|
|||
return (
|
||||
<span
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: this.renderMarkdown(this.props.source)
|
||||
__html: this.renderMarkdown(this.props.source),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
@ -31,14 +31,14 @@ class MarkdownBlock extends React.Component {
|
|||
|
||||
renderMarkdown(source) {
|
||||
const alias = {
|
||||
js: 'jsx'
|
||||
js: 'jsx',
|
||||
};
|
||||
const {siteConfig} = this.props;
|
||||
const md = new Markdown({
|
||||
langPrefix: 'hljs css language-',
|
||||
highlight: highlight,
|
||||
html: true,
|
||||
linkify: true
|
||||
linkify: true,
|
||||
});
|
||||
|
||||
// Register anchors plugin
|
||||
|
@ -64,9 +64,9 @@ class MarkdownBlock extends React.Component {
|
|||
{},
|
||||
{
|
||||
version: '9.12.0',
|
||||
theme: 'default'
|
||||
theme: 'default',
|
||||
},
|
||||
siteConfig.highlight
|
||||
siteConfig.highlight,
|
||||
);
|
||||
|
||||
// Use user-provided themeUrl if it exists, else construct one from version and theme.
|
||||
|
@ -88,7 +88,7 @@ class MarkdownBlock extends React.Component {
|
|||
}
|
||||
|
||||
MarkdownBlock.defaultProps = {
|
||||
siteConfig: {}
|
||||
siteConfig: {},
|
||||
};
|
||||
|
||||
export default MarkdownBlock;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue