diff options
author | Joe Mooring <joe.mooring@veriphor.com> | 2024-12-31 08:35:22 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-12-31 15:46:46 +0100 |
commit | 2db43f841c7d2db0edcb3a3478c0833c38ae5997 (patch) | |
tree | 45a2f0d79f5f0b00fb163d14d905b54ae056cae4 /markup | |
parent | 46ce1f191bbc4c263e3c4fafad8ad8a16a81450c (diff) | |
download | hugo-2db43f841c7d2db0edcb3a3478c0833c38ae5997.tar.gz hugo-2db43f841c7d2db0edcb3a3478c0833c38ae5997.zip |
markup/highlight: Remove noHl option
Closes #9885
Diffstat (limited to 'markup')
-rw-r--r-- | markup/highlight/config.go | 6 | ||||
-rw-r--r-- | markup/highlight/highlight.go | 2 | ||||
-rw-r--r-- | markup/internal/attributes/attributes.go | 1 |
3 files changed, 1 insertions, 8 deletions
diff --git a/markup/highlight/config.go b/markup/highlight/config.go index 338ea77e5..b19e9ec1b 100644 --- a/markup/highlight/config.go +++ b/markup/highlight/config.go @@ -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" diff --git a/markup/highlight/highlight.go b/markup/highlight/highlight.go index 30f225c0b..ee07fb9ad 100644 --- a/markup/highlight/highlight.go +++ b/markup/highlight/highlight.go @@ -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 diff --git a/markup/internal/attributes/attributes.go b/markup/internal/attributes/attributes.go index 9c147f766..b2d4a5ed6 100644 --- a/markup/internal/attributes/attributes.go +++ b/markup/internal/attributes/attributes.go @@ -36,7 +36,6 @@ var chromaHighlightProcessingAttributes = map[string]bool{ "lineNoStart": true, "lineNumbersInTable": true, "noClasses": true, - "nohl": true, "style": true, "tabWidth": true, } |