mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-05 18:44:58 +03:00
markdown: Fix panic: assignment to entry in nil map
Ensures metadata.Variables is made
This commit is contained in:
parent
f2f7e6825f
commit
8ea98f8cce
2 changed files with 4 additions and 4 deletions
|
@ -12,9 +12,9 @@ import (
|
|||
|
||||
var (
|
||||
parsers = []MetadataParser{
|
||||
&JSONMetadataParser{},
|
||||
&TOMLMetadataParser{},
|
||||
&YAMLMetadataParser{},
|
||||
&JSONMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
|
||||
&TOMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
|
||||
&YAMLMetadataParser{metadata: Metadata{Variables: make(map[string]interface{})}},
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ const (
|
|||
// process processes the contents of a page.
|
||||
// It parses the metadata (if any) and uses the template (if found)
|
||||
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 err error
|
||||
|
||||
|
|
Loading…
Reference in a new issue