Commit 8ea98f8c authored by Matthew Holt's avatar Matthew Holt

markdown: Fix panic: assignment to entry in nil map

Ensures metadata.Variables is made
parent f2f7e682
...@@ -12,9 +12,9 @@ import ( ...@@ -12,9 +12,9 @@ import (
var ( var (
parsers = []MetadataParser{ parsers = []MetadataParser{
&JSONMetadataParser{}, &JSONMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
&TOMLMetadataParser{}, &TOMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
&YAMLMetadataParser{}, &YAMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
} }
) )
......
...@@ -21,7 +21,7 @@ const ( ...@@ -21,7 +21,7 @@ const (
// process processes the contents of a page. // process processes the contents of a page.
// It parses the metadata (if any) and uses the template (if found) // It parses the metadata (if any) and uses the template (if found)
func (md Markdown) process(c Config, requestPath string, b []byte) ([]byte, error) { func (md Markdown) process(c Config, requestPath string, b []byte) ([]byte, error) {
var metadata = Metadata{} var metadata = Metadata{Variables: make(map[string]interface{})}
var markdown []byte var markdown []byte
var err error var err error
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment