mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-08 19:36:36 +02:00
committed by
Bjørn Erik Pedersen
parent
46ce1f191b
commit
2db43f841c
@@ -33,7 +33,6 @@ const (
|
||||
lineNosKey = "linenos"
|
||||
hlLinesKey = "hl_lines"
|
||||
linosStartKey = "linenostart"
|
||||
noHlKey = "nohl"
|
||||
)
|
||||
|
||||
var DefaultConfig = Config{
|
||||
@@ -60,9 +59,6 @@ type Config struct {
|
||||
// Use inline CSS styles.
|
||||
NoClasses bool
|
||||
|
||||
// No highlighting.
|
||||
NoHl bool
|
||||
|
||||
// When set, line numbers will be printed.
|
||||
LineNos bool
|
||||
LineNumbersInTable bool
|
||||
@@ -234,8 +230,6 @@ func normalizeHighlightOptions(m map[string]any) {
|
||||
|
||||
for k, v := range m {
|
||||
switch k {
|
||||
case noHlKey:
|
||||
m[noHlKey] = cast.ToBool(v)
|
||||
case lineNosKey:
|
||||
if v == "table" || v == "inline" {
|
||||
m["lineNumbersInTable"] = v == "table"
|
||||
|
@@ -168,7 +168,7 @@ func highlight(fw hugio.FlexiWriter, code, lang string, attributes []attributes.
|
||||
lexer = chromalexers.Get(lang)
|
||||
}
|
||||
|
||||
if lexer == nil && (cfg.GuessSyntax && !cfg.NoHl) {
|
||||
if lexer == nil && cfg.GuessSyntax {
|
||||
lexer = lexers.Analyse(code)
|
||||
if lexer == nil {
|
||||
lexer = lexers.Fallback
|
||||
|
Reference in New Issue
Block a user