Use Chroma as new default syntax highlighter

If you want to use Pygments, set `pygmentsUseClassic=true` in your site config.

Fixes #3888
This commit is contained in:
Bjørn Erik Pedersen
2017-09-25 08:59:02 +02:00
committed by GitHub
parent 81ed564793
commit fb33d8286d
18 changed files with 652 additions and 108 deletions

View File

@@ -55,7 +55,8 @@ func (ns *Namespace) Highlight(s interface{}, lang, opts string) (template.HTML,
return "", err
}
return template.HTML(helpers.Highlight(ns.deps.Cfg, html.UnescapeString(ss), lang, opts)), nil
highlighted, _ := ns.deps.ContentSpec.Highlight(html.UnescapeString(ss), lang, opts)
return template.HTML(highlighted), nil
}
// HTMLEscape returns a copy of s with reserved HTML characters escaped.