Skip to content

Commit

Permalink
Revert "markup/highlight: Add hl_inline option"
Browse files Browse the repository at this point in the history
This reverts commit a360cab.
  • Loading branch information
bep committed Mar 10, 2022
1 parent 4e14cf7 commit b82d955
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 72 deletions.
3 changes: 0 additions & 3 deletions markup/highlight/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ type Config struct {
// A space separated list of line numbers, e.g. “3-8 10-20”.
Hl_Lines string

// If set, the markup will not be wrapped in any container.
Hl_inline bool

// A parsed and ready to use list of line ranges.
HL_lines_parsed [][2]int `json:"-"`

Expand Down
17 changes: 2 additions & 15 deletions markup/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,11 @@ func (h chromaHighlighter) Highlight(code, lang string, opts interface{}) (strin
}
var b strings.Builder

low, high, err := highlight(&b, code, lang, nil, cfg)

if err != nil {
if _, _, err := highlight(&b, code, lang, nil, cfg); err != nil {
return "", err
}

if !cfg.Hl_inline {
return b.String(), nil
}

hr := HightlightResult{
highlighted: template.HTML(b.String()),
innerLow: low,
innerHigh: high,
}

return string(hr.Inner()), nil

return b.String(), nil
}

func (h chromaHighlighter) HighlightCodeBlock(ctx hooks.CodeblockContext, opts interface{}) (HightlightResult, error) {
Expand Down
53 changes: 0 additions & 53 deletions markup/highlight/integration_test.go

This file was deleted.

1 change: 0 additions & 1 deletion markup/internal/attributes/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var chromaHightlightProcessingAttributes = map[string]bool{
"nohl": true,
"style": true,
"tabWidth": true,
"hl_inline": true, // New in 0.94.0.
}

func init() {
Expand Down

0 comments on commit b82d955

Please sign in to comment.