summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-01-04 23:48:05 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-01-04 23:48:05 +0100
commit9ff36c5a8f9a09754c67f6019aba79ebc08d164f (patch)
tree987ee026b5d290902bc0fda7922ab95ae23c6b93 /hugolib/site_test.go
parent7bc5d3663fc0fdb87bb21235fe3b3cc534129ce1 (diff)
Add some trailing newline shortcode tests
See #1753
Diffstat (limited to 'hugolib/site_test.go')
-rw-r--r--hugolib/site_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
index 15cdc02d8..68fb5e5fc 100644
--- a/hugolib/site_test.go
+++ b/hugolib/site_test.go
@@ -344,6 +344,9 @@ func doTestCrossrefs(t *testing.T, relative, uglyURLs bool) {
{{< %s "sect/doc1.md" >}}
THE END.`, refShortcode))},
+ // Issue #1753: Should not add a trailing newline after shortcode.
+ {filepath.FromSlash("sect/doc3.md"),
+ []byte(fmt.Sprintf(`**Ref 1:**{{< %s "sect/doc3.md" >}}.`, refShortcode))},
}
s := &Site{
@@ -364,6 +367,7 @@ THE END.`, refShortcode))},
}{
{filepath.FromSlash(fmt.Sprintf("sect/doc1%s", expectedPathSuffix)), fmt.Sprintf("<p>Ref 2: %s/sect/doc2%s</p>\n", expectedBase, expectedURLSuffix)},
{filepath.FromSlash(fmt.Sprintf("sect/doc2%s", expectedPathSuffix)), fmt.Sprintf("<p><strong>Ref 1:</strong></p>\n\n%s/sect/doc1%s\n\n<p>THE END.</p>\n", expectedBase, expectedURLSuffix)},
+ {filepath.FromSlash(fmt.Sprintf("sect/doc3%s", expectedPathSuffix)), fmt.Sprintf("<p><strong>Ref 1:</strong>%s/sect/doc3%s.</p>\n", expectedBase, expectedURLSuffix)},
}
for _, test := range tests {
@@ -1038,10 +1042,9 @@ func setupLinkingMockSite(t *testing.T) *Site {
{filepath.FromSlash("level2/index.md"), []byte("")},
{filepath.FromSlash("level2/common.md"), []byte("")},
-
-// {filepath.FromSlash("level2b/2b-root.md"), []byte("")},
-// {filepath.FromSlash("level2b/index.md"), []byte("")},
-// {filepath.FromSlash("level2b/common.md"), []byte("")},
+ // {filepath.FromSlash("level2b/2b-root.md"), []byte("")},
+ // {filepath.FromSlash("level2b/index.md"), []byte("")},
+ // {filepath.FromSlash("level2b/common.md"), []byte("")},
{filepath.FromSlash("level2/2-image.png"), []byte("")},
{filepath.FromSlash("level2/common.png"), []byte("")},