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 {
1036
1036
We also need to update the ` Comment ` component to use ` Remarkable ` from either ` global ` or ` window ` , due to a bug in Remarkable:
1037
1037
1038
1038
``` 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
+
1039
1048
class Comment extends React.Component {
1040
1049
rawMarkup() {
1041
- const md = new (global.Remarkable || window.Remarkable) ();
1050
+ const md = createRemarkable ();
1042
1051
const rawMarkup = md.render(this.props.children.toString());
1043
1052
return { __html: rawMarkup };
1044
1053
}
Original file line number Diff line number Diff line change @@ -1020,9 +1020,18 @@ class CommentBox extends React.Component {
1020
1020
We also need to update the ` Comment ` component to use ` Remarkable ` from either ` global ` or ` window ` , due to a bug in Remarkable:
1021
1021
1022
1022
``` 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
+
1023
1032
class Comment extends React.Component {
1024
1033
rawMarkup() {
1025
- const md = new (global.Remarkable || window.Remarkable) ();
1034
+ const md = createRemarkable ();
1026
1035
const rawMarkup = md.render(this.props.children.toString());
1027
1036
return { __html: rawMarkup };
1028
1037
}
You can’t perform that action at this time.
0 commit comments