]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
markup/highlight: Remove noHl option
authorJoe Mooring <joe.mooring@veriphor.com>
Tue, 31 Dec 2024 13:35:22 +0000 (08:35 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 31 Dec 2024 14:46:46 +0000 (15:46 +0100)
Closes #9885

markup/highlight/config.go
markup/highlight/highlight.go
markup/internal/attributes/attributes.go

index 338ea77e5028501718bd305f374749e66004d3df..b19e9ec1b003e7448f1173820190674fd896c9b1 100644 (file)
@@ -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"
index 30f225c0b2f1301edf52eb61e7a399f99be65897..ee07fb9ad797259e0f5cf8ef620d455218c91d6c 100644 (file)
@@ -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
index 9c147f7669334c77cfb1bda4c526169e2273c9a6..b2d4a5ed6e381b20cca78f39515ccb95edfcbbf8 100644 (file)
@@ -36,7 +36,6 @@ var chromaHighlightProcessingAttributes = map[string]bool{
        "lineNoStart":        true,
        "lineNumbersInTable": true,
        "noClasses":          true,
-       "nohl":               true,
        "style":              true,
        "tabWidth":           true,
 }