Skip to content

Commit 0d29a0f

Browse files
committed
Trim newlines in the hightlight shortcode
Fixes #3898
1 parent b8fabce commit 0d29a0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎tpl/tplimpl/template_embedded.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package tplimpl
1616
func (t *templateHandler) embedShortcodes() {
1717
t.addInternalShortcode("ref.html", `{{ if len .Params | eq 2 }}{{ ref .Page (.Get 0) (.Get 1) }}{{ else }}{{ ref .Page (.Get 0) }}{{ end }}`)
1818
t.addInternalShortcode("relref.html", `{{ if len .Params | eq 2 }}{{ relref .Page (.Get 0) (.Get 1) }}{{ else }}{{ relref .Page (.Get 0) }}{{ end }}`)
19-
t.addInternalShortcode("highlight.html", `{{ if len .Params | eq 2 }}{{ highlight .Inner (.Get 0) (.Get 1) }}{{ else }}{{ highlight .Inner (.Get 0) "" }}{{ end }}`)
19+
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 }}`)
2020
t.addInternalShortcode("test.html", `This is a simple Test`)
2121
t.addInternalShortcode("figure.html", `<!-- image -->
2222
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>

0 commit comments

Comments
 (0)