Skip to content

Commit 3325e54

Browse files
committed
forgot to call function
1 parent 85049d5 commit 3325e54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/highlight/highlight.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
once sync.Once
2727
)
2828

29-
// NewContext loads highlight map
29+
// NewContext loads custom highlight map from local config
3030
func NewContext() {
3131
once.Do(func() {
3232
keys := setting.Cfg.Section("highlight.mapping").Keys()
@@ -38,6 +38,7 @@ func NewContext() {
3838

3939
// Code returns a HTML version of code string with chroma syntax highlighting classes
4040
func Code(fileName, code string) string {
41+
NewContext()
4142
formatter := html.New(html.WithClasses(true),
4243
html.WithLineNumbers(false),
4344
html.PreventSurroundingPre(true),
@@ -78,6 +79,7 @@ func Code(fileName, code string) string {
7879

7980
// File returns map with line lumbers and HTML version of code with chroma syntax highlighting classes
8081
func File(numLines int, fileName string, code []byte) map[int]string {
82+
NewContext()
8183
m := make(map[int]string, numLines)
8284

8385
formatter := html.New(html.WithClasses(true),

0 commit comments

Comments
 (0)