Skip to content

Commit

Permalink
Trim newlines in the hightlight shortcode
Browse files Browse the repository at this point in the history
Fixes #3898
  • Loading branch information
bep committed Sep 23, 2017
1 parent b8fabce commit 0d29a0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tpl/tplimpl/template_embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}>
Expand Down

0 comments on commit 0d29a0f

Please sign in to comment.