Add site-wide/per-page [blackfriday] extensions option

This commit is contained in:
Naoya Inada
2015-01-25 20:08:02 +09:00
committed by bep
parent 39b2cdece0
commit 407e80a9ab
7 changed files with 126 additions and 59 deletions

View File

@@ -212,6 +212,16 @@ the cylinder and strike me down. ## BB
### BBB
"You're a great Granser," he cried delightedly, "always making believe them little marks mean something."
`
SIMPLE_PAGE_WITH_ADDITIONAL_EXTENSION = `+++
[blackfriday]
extensions = ["hardLineBreak"]
+++
first line.
second line.
fourth line.
`
)
@@ -366,6 +376,16 @@ func TestPageWithEmbeddedScriptTag(t *testing.T) {
checkPageContent(t, p, "<script type='text/javascript'>alert('the script tags are still there, right?');</script>\n")
}
func TestPageWithAdditionalExtension(t *testing.T) {
p, _ := NewPage("simple.md")
err := p.ReadFrom(strings.NewReader(SIMPLE_PAGE_WITH_ADDITIONAL_EXTENSION))
p.Convert()
if err != nil {
t.Fatalf("Unable to create a page with frontmatter and body content: %s", err)
}
checkPageContent(t, p, "<p>first line.<br />\nsecond line.</p>\n\n<p>fourth line.</p>\n")
}
func TestTableOfContents(t *testing.T) {
p, _ := NewPage("tocpage.md")
err := p.ReadFrom(strings.NewReader(PAGE_WITH_TOC))