mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
Add PygmentsOptions option
This allows default pygments settings to be used, if none are explictly set per shortcode. Fixes #1260
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
99acbb2eb2
commit
c3931ef748
@@ -17,8 +17,9 @@ type HugoHtmlRenderer struct {
|
||||
|
||||
func (renderer *HugoHtmlRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) {
|
||||
if viper.GetBool("PygmentsCodeFences") {
|
||||
opts := viper.GetString("PygmentsOptions")
|
||||
str := html.UnescapeString(string(text))
|
||||
out.WriteString(Highlight(str, lang, ""))
|
||||
out.WriteString(Highlight(str, lang, opts))
|
||||
} else {
|
||||
renderer.Renderer.BlockCode(out, text, lang)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user