diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-10-13 09:37:47 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-10-14 16:00:27 +0200 |
commit | 7c30e2cbb08fdf0e61f80c7f1aa29909aeca4211 (patch) | |
tree | c80336ec0905a23f0794f9c4d8dfb11f67fa5aba /helpers/pygments.go | |
parent | 60bd332c1f68e49e6ac439047e7c660865189380 (diff) |
Add table linenos support for Chroma highlighter
Fixes #3915
Diffstat (limited to 'helpers/pygments.go')
-rw-r--r-- | helpers/pygments.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/helpers/pygments.go b/helpers/pygments.go index 9253445e7..4a90e353d 100644 --- a/helpers/pygments.go +++ b/helpers/pygments.go @@ -40,7 +40,6 @@ import ( const pygmentsBin = "pygmentize" -// TODO(bep) document chroma -s perldoc --html --html-styles // hasPygments checks to see if Pygments is installed and available // on the system. func hasPygments() bool { @@ -309,8 +308,12 @@ func (cs *ContentSpec) chromaFormatterFromOptions(pygmentsOpts map[string]string options = append(options, html.WithClasses()) } - if pygmentsOpts["linenos"] != "" { + lineNumbers := pygmentsOpts["linenos"] + if lineNumbers != "" { options = append(options, html.WithLineNumbers()) + if lineNumbers != "inline" { + options = append(options, html.LineNumbersInTable()) + } } startLineStr := pygmentsOpts["linenostart"] |