File tree Expand file tree Collapse file tree 1 file changed +15
-20
lines changed
Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Original file line number Diff line number Diff 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-
3414func OpenInBrowser (url string ) error {
3515 browser := os .Getenv ("BROWSER" )
3616 if browser == "" {
@@ -86,6 +66,21 @@ func normalizeNewlines(d []byte) []byte {
8666func 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}
You can’t perform that action at this time.
0 commit comments