mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Add site-wide/per-page [blackfriday] extensions option
				
					
				
			This commit is contained in:
		@@ -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))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user