From bee52f85aee6383b357406baa9ba1e3b725a5a80 Mon Sep 17 00:00:00 2001 From: bep Date: Thu, 16 Apr 2015 02:20:15 +0200 Subject: [PATCH] Fix broken Highlight test --- hugolib/shortcode_test.go | 3 +-- tpl/template_embedded.go | 8 +------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 2c48162e5..ad1bd3ac8 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -143,8 +143,7 @@ func TestFigureImgWidth(t *testing.T) { CheckShortCodeMatch(t, `{{% figure src="/found/here" class="bananas orange" alt="apple" width="100px" %}}`, "\n
\n \n \"apple\"\n \n \n
\n", tem) } -// TODO(bep) -func _TestHighlight(t *testing.T) { +func TestHighlight(t *testing.T) { if !helpers.HasPygments() { t.Skip("Skip test as Pygments is not installed") } diff --git a/tpl/template_embedded.go b/tpl/template_embedded.go index 48de62cb6..317959f29 100644 --- a/tpl/template_embedded.go +++ b/tpl/template_embedded.go @@ -21,13 +21,7 @@ type Tmpl struct { func (t *GoHTMLTemplate) EmbedShortcodes() { t.AddInternalShortcode("ref.html", `{{ .Get 0 | ref .Page }}`) t.AddInternalShortcode("relref.html", `{{ .Get 0 | relref .Page }}`) - 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 .Inner (.Get 0) (.Get 1) }}{{ else }}{{ highlight .Inner (.Get 0) "" }}{{ end }}`) t.AddInternalShortcode("test.html", `This is a simple Test`) t.AddInternalShortcode("figure.html", `