File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1036,9 +1036,18 @@ class CommentBox extends React.Component {
10361036We also need to update the ` Comment ` component to use ` Remarkable ` from either ` global ` or ` window ` , due to a bug in Remarkable:
10371037
10381038``` javascript{3}
1039+ function createRemarkable() {
1040+ var remarkable =
1041+ 'undefined' != typeof global && global.Remarkable
1042+ ? global.Remarkable
1043+ : window.Remarkable;
1044+
1045+ return new remarkable();
1046+ }
1047+
10391048class Comment extends React.Component {
10401049 rawMarkup() {
1041- const md = new (global.Remarkable || window.Remarkable) ();
1050+ const md = createRemarkable ();
10421051 const rawMarkup = md.render(this.props.children.toString());
10431052 return { __html: rawMarkup };
10441053 }
Original file line number Diff line number Diff line change @@ -1020,9 +1020,18 @@ class CommentBox extends React.Component {
10201020We also need to update the ` Comment ` component to use ` Remarkable ` from either ` global ` or ` window ` , due to a bug in Remarkable:
10211021
10221022``` javascript{3}
1023+ function createRemarkable() {
1024+ var remarkable =
1025+ 'undefined' != typeof global && global.Remarkable
1026+ ? global.Remarkable
1027+ : window.Remarkable;
1028+
1029+ return new remarkable();
1030+ }
1031+
10231032class Comment extends React.Component {
10241033 rawMarkup() {
1025- const md = new (global.Remarkable || window.Remarkable) ();
1034+ const md = createRemarkable ();
10261035 const rawMarkup = md.render(this.props.children.toString());
10271036 return { __html: rawMarkup };
10281037 }
You can’t perform that action at this time.
0 commit comments