summaryrefslogtreecommitdiffstats
path: root/hugolib/page_test.go
diff options
context:
space:
mode:
authorJake Mitchell <jacob.d.mitchell@gmail.com>2014-05-29 20:42:12 -0700
committerspf13 <steve.francia@gmail.com>2014-06-03 15:14:38 -0400
commite0ea6b995596514266c4a4ba3707df7df126d04a (patch)
treeff2ad888c42e536feb4dfdedf9ba6031a6053e7f /hugolib/page_test.go
parent7b7ce11787ca60b8c95f6385230335347ef0b3db (diff)
Support embedding <script> tags in markdown pages
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 0ade5c950..5bd812e6e 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -120,6 +120,12 @@ More text here.
Some more text
`
+ SIMPLE_PAGE_WITH_EMBEDDED_SCRIPT = `---
+title: Simple
+---
+<script type='text/javascript'>alert('the script tags are still there, right?');</script>
+`
+
SIMPLE_PAGE_WITH_SUMMARY_DELIMITER_SAME_LINE = `---
title: Simple
---
@@ -340,6 +346,16 @@ func TestPageWithShortCodeInSummary(t *testing.T) {
checkPageLayout(t, p, "page/single.html", "single.html")
}
+func TestPageWithEmbeddedScriptTag(t *testing.T) {
+ p, _ := NewPage("simple.md")
+ err := p.ReadFrom(strings.NewReader(SIMPLE_PAGE_WITH_EMBEDDED_SCRIPT))
+ p.Convert()
+ if err != nil {
+ t.Fatalf("Unable to create a page with frontmatter and body content: %s", err)
+ }
+ checkPageContent(t, p, "<script type='text/javascript'>alert('the script tags are still there, right?');</script>\n")
+}
+
func TestTableOfContents(t *testing.T) {
p, _ := NewPage("tocpage.md")
err := p.ReadFrom(strings.NewReader(PAGE_WITH_TOC))