X Tutup
Skip to content

Commit bc1ab20

Browse files
committed
turns out this has frightening state
1 parent bbdf30c commit bc1ab20

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

utils/utils.go

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@ import (
1111
"github.com/kballard/go-shellquote"
1212
)
1313

14-
var mdCompiler md.Compiler
15-
16-
func init() {
17-
mdCompiler = md.Compiler{
18-
Columns: 100,
19-
SyntaxHighlighter: md.SyntaxTheme{
20-
"keyword": md.Style{Color: "#9196ed"},
21-
"comment": md.Style{
22-
Color: "#c0c0c2",
23-
},
24-
"literal": md.Style{
25-
Color: "#aaedf7",
26-
},
27-
"name": md.Style{
28-
Color: "#fe8eb5",
29-
},
30-
},
31-
}
32-
}
33-
3414
func OpenInBrowser(url string) error {
3515
browser := os.Getenv("BROWSER")
3616
if browser == "" {
@@ -86,6 +66,21 @@ func normalizeNewlines(d []byte) []byte {
8666
func RenderMarkdown(text string) string {
8767
textB := []byte(text)
8868
textB = normalizeNewlines(textB)
69+
mdCompiler := md.Compiler{
70+
Columns: 100,
71+
SyntaxHighlighter: md.SyntaxTheme{
72+
"keyword": md.Style{Color: "#9196ed"},
73+
"comment": md.Style{
74+
Color: "#c0c0c2",
75+
},
76+
"literal": md.Style{
77+
Color: "#aaedf7",
78+
},
79+
"name": md.Style{
80+
Color: "#fe8eb5",
81+
},
82+
},
83+
}
8984

9085
return mdCompiler.Compile(string(textB))
9186
}

0 commit comments

Comments
 (0)
X Tutup