From eff0de5330e9c6db3cb13ed39fb310b16075a22a Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 12 Aug 2020 01:37:55 -0700 Subject: [PATCH] Allow the codelines shortcode to use hl_lines. --- themes/vanilla/layouts/shortcodes/codelines.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/vanilla/layouts/shortcodes/codelines.html b/themes/vanilla/layouts/shortcodes/codelines.html index 6b0b44b..2d50698 100644 --- a/themes/vanilla/layouts/shortcodes/codelines.html +++ b/themes/vanilla/layouts/shortcodes/codelines.html @@ -6,4 +6,9 @@ {{ .Scratch.Set "u" $t }} {{ end }} {{ $v := first (add (sub (int (.Get 3)) (int (.Get 2))) 1) (.Scratch.Get "u") }} -{{ highlight (delimit $v "\n") (.Get 0) (printf "linenos=table,linenostart=%d" (.Get 2)) }} +{{ if (.Get 4) }} +{{ .Scratch.Set "opts" (printf ",%s" (.Get 4)) }} +{{ else }} +{{ .Scratch.Set "opts" "" }} +{{ end }} +{{ highlight (delimit $v "\n") (.Get 0) (printf "linenos=table,linenostart=%d%s" (.Get 2) (.Scratch.Get "opts")) }}