Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
8ea98f8c
Commit
8ea98f8c
authored
May 09, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
markdown: Fix panic: assignment to entry in nil map
Ensures metadata.Variables is made
parent
f2f7e682
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
middleware/markdown/metadata.go
middleware/markdown/metadata.go
+3
-3
middleware/markdown/process.go
middleware/markdown/process.go
+1
-1
No files found.
middleware/markdown/metadata.go
View file @
8ea98f8c
...
@@ -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
{})}
},
}
}
)
)
...
...
middleware/markdown/process.go
View file @
8ea98f8c
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment