mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
ESLintify Part 1 (#837)
* ESLint-ify * Allow empty try/catch * Escape regexp
This commit is contained in:
parent
128dbfca0a
commit
e8e3f42685
44 changed files with 466 additions and 555 deletions
|
@ -5,8 +5,6 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const React = require('react');
|
||||
const renderMarkdown = require('./renderMarkdown.js');
|
||||
|
||||
|
@ -20,22 +18,21 @@ class Remarkable extends React.Component {
|
|||
}}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return React.Children.map(this.props.children, child => {
|
||||
if (typeof child === 'string') {
|
||||
return (
|
||||
<span dangerouslySetInnerHTML={{__html: renderMarkdown(child)}} />
|
||||
);
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return React.Children.map(this.props.children, child => {
|
||||
if (typeof child === 'string') {
|
||||
return (
|
||||
<span dangerouslySetInnerHTML={{__html: renderMarkdown(child)}} />
|
||||
);
|
||||
}
|
||||
|
||||
return child;
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
var Container = this.props.container;
|
||||
|
||||
const Container = this.props.container;
|
||||
return <Container>{this.content()}</Container>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue