diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go index 2bd77af0b2a..4727843ccdd 100644 --- a/markup/highlight/highlight.go +++ b/markup/highlight/highlight.go @@ -37,12 +37,15 @@ type Highlighter struct { } func (h Highlighter) Highlight(code, lang, optsStr string) (string, error) { + if optsStr == "" { + return highlight(code, lang, h.cfg) + } + cfg := h.cfg - if optsStr != "" { - if err := applyOptionsFromString(optsStr, &cfg); err != nil { - return "", err - } + if err := applyOptionsFromString(optsStr, &cfg); err != nil { + return "", err } + return highlight(code, lang, cfg) }