File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ type Config struct {
93
93
OnComplete template.JS `json:"-"`
94
94
95
95
// An object with the activate and theme properties.
96
- SyntaxHighlight * SyntaxHighlightConfig `json:"syntaxHighlight,omitempty "`
96
+ SyntaxHighlight * SyntaxHighlightConfig `json:"- "`
97
97
98
98
// Controls whether the "Try it out" section should be enabled by default.
99
99
// default: false
@@ -199,6 +199,13 @@ type SyntaxHighlightConfig struct {
199
199
Theme string `json:"theme,omitempty"`
200
200
}
201
201
202
+ func (shc SyntaxHighlightConfig ) Value () interface {} {
203
+ if shc .Activate {
204
+ return shc
205
+ }
206
+ return false
207
+ }
208
+
202
209
type OAuthConfig struct {
203
210
// ID of the client sent to the OAuth2 provider.
204
211
// default: ""
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ const indexTmpl string = `
61
61
{{- end}}
62
62
];
63
63
config.filter = {{.Filter.Value}}
64
+ config.syntaxHighlight = {{.SyntaxHighlight.Value}}
64
65
{{if .TagsSorter}}
65
66
config.tagsSorter = {{.TagsSorter}}
66
67
{{end}}
You can’t perform that action at this time.
0 commit comments