Skip to content

Commit aa17708

Browse files
authored
fix: extract instantiation of Remarkable (#2813)
1 parent 78793ef commit aa17708

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/home/examples/a-component-using-external-plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class MarkdownEditor extends React.Component {
22
constructor(props) {
33
super(props);
4+
this.md = new Remarkable();
45
this.handleChange = this.handleChange.bind(this);
56
this.state = { value: 'Hello, **world**!' };
67
}
@@ -10,8 +11,7 @@ class MarkdownEditor extends React.Component {
1011
}
1112

1213
getRawMarkup() {
13-
const md = new Remarkable();
14-
return { __html: md.render(this.state.value) };
14+
return { __html: this.md.render(this.state.value) };
1515
}
1616

1717
render() {

0 commit comments

Comments
 (0)