diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-09-23 19:14:07 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-09-23 19:14:07 +0300 |
commit | 0d29a0f7819e8d73149701052c29f090cd6db42b (patch) | |
tree | 8e648d5363e386460852104e7f81dc94e64581ba /tpl | |
parent | b8fabce217fcb52e3f273491bef95c7977058732 (diff) |
Trim newlines in the hightlight shortcode
Fixes #3898
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/template_embedded.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/tplimpl/template_embedded.go b/tpl/tplimpl/template_embedded.go index 2eb9b2283..dd3254560 100644 --- a/tpl/tplimpl/template_embedded.go +++ b/tpl/tplimpl/template_embedded.go @@ -16,7 +16,7 @@ package tplimpl func (t *templateHandler) embedShortcodes() { t.addInternalShortcode("ref.html", `{{ if len .Params | eq 2 }}{{ ref .Page (.Get 0) (.Get 1) }}{{ else }}{{ ref .Page (.Get 0) }}{{ end }}`) t.addInternalShortcode("relref.html", `{{ if len .Params | eq 2 }}{{ relref .Page (.Get 0) (.Get 1) }}{{ else }}{{ relref .Page (.Get 0) }}{{ end }}`) - t.addInternalShortcode("highlight.html", `{{ if len .Params | eq 2 }}{{ highlight .Inner (.Get 0) (.Get 1) }}{{ else }}{{ highlight .Inner (.Get 0) "" }}{{ end }}`) + t.addInternalShortcode("highlight.html", `{{ if len .Params | eq 2 }}{{ highlight (trim .Inner "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .Inner "\n\r") (.Get 0) "" }}{{ end }}`) t.addInternalShortcode("test.html", `This is a simple Test`) t.addInternalShortcode("figure.html", `<!-- image --> <figure {{ with .Get "class" }}class="{{.}}"{{ end }}> |