Skip to content

Commit

Permalink
markup/highlight: Remove noHl option
Browse files Browse the repository at this point in the history
Closes #9885
  • Loading branch information
jmooring authored and bep committed Dec 31, 2024
1 parent 46ce1f1 commit 2db43f8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions markup/highlight/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const (
lineNosKey = "linenos"
hlLinesKey = "hl_lines"
linosStartKey = "linenostart"
noHlKey = "nohl"
)

var DefaultConfig = Config{
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion markup/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion markup/internal/attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var chromaHighlightProcessingAttributes = map[string]bool{
"lineNoStart": true,
"lineNumbersInTable": true,
"noClasses": true,
"nohl": true,
"style": true,
"tabWidth": true,
}
Expand Down

0 comments on commit 2db43f8

Please sign in to comment.