summaryrefslogtreecommitdiffstats
path: root/hugolib/site_url_test.go
diff options
context:
space:
mode:
authorNoah Campbell <noahcampbell@gmail.com>2013-09-18 09:15:46 -0700
committerNoah Campbell <noahcampbell@gmail.com>2013-09-18 09:15:46 -0700
commitd8e1834910d2b845ee5066571a61be49a7a1451c (patch)
tree7ef6b512842a2ea44327cacab18a1d585d81dcef /hugolib/site_url_test.go
parenta82efe5bb131f1d4a811d3220c2ce40d56aa9eaf (diff)
Fix parsing edge case of frontmatter
When the frontmatter contains a - (or other delimiter) close to the closing frontmatter delimiter, frontmatter detection would fail.
Diffstat (limited to 'hugolib/site_url_test.go')
-rw-r--r--hugolib/site_url_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/hugolib/site_url_test.go b/hugolib/site_url_test.go
index ef226fe7f..b9c30fec4 100644
--- a/hugolib/site_url_test.go
+++ b/hugolib/site_url_test.go
@@ -10,7 +10,12 @@ import (
const SLUG_DOC_1 = "---\ntitle: slug doc 1\nslug: slug-doc-1\naliases:\n - sd1/foo/\n - sd2\n - sd3/\n - sd4.html\n---\nslug doc 1 content\n"
-const SLUG_DOC_2 = "---\ntitle: slug doc 2\nslug: slug-doc-2\n---\nslug doc 2 content\n"
+const SLUG_DOC_2 = `---
+title: slug doc 2
+slug: slug-doc-2
+---
+slug doc 2 content
+`
const INDEX_TEMPLATE = "{{ range .Data.Pages }}.{{ end }}"
@@ -58,7 +63,7 @@ func (t *InMemoryAliasTarget) Publish(label string, permalink template.HTML) (er
var urlFakeSource = []byteSource{
{"content/blue/doc1.md", []byte(SLUG_DOC_1)},
-// {"content/blue/doc2.md", []byte(SLUG_DOC_2)},
+ {"content/blue/doc2.md", []byte(SLUG_DOC_2)},
}
func TestPageCount(t *testing.T) {
@@ -95,7 +100,7 @@ func TestPageCount(t *testing.T) {
t.Errorf("No indexed rendered. %v", target.files)
}
- expected := "<html><head></head><body>.</body></html>"
+ expected := "<html><head></head><body>..</body></html>"
if string(blueIndex) != expected {
t.Errorf("Index template does not match expected: %q, got: %q", expected, string(blueIndex))
}