parser: Refactor frontmatter parser and add tests
authorCameron Moore <moorereason@gmail.com>
Mon, 26 Dec 2016 21:23:20 +0000 (15:23 -0600)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 11 Mar 2017 16:52:25 +0000 (17:52 +0100)
commitf039e3be9e4a11808508c8cd3043b340deea040f
treedf3e709fc6321fd2a3e1d23efa2c3512d8ed4a94
parentddc8cc0082965143a650052a9aa538bac9133481
parser: Refactor frontmatter parser and add tests

Lots of cleanups here:

- Refactor InterfaceToConfig and InterfaceToFrontMatter to use io.Writer.
- Simplify InterfaceToFrontMatter by wrapping InterfaceToConfig.
- Export FrontmatterType since we return it in DetectFrontMatter.
- Refactor removeTOMLIdentifier to avoid blindly replacing "+++".
- Update HandleJSONMetaData to return an empty map on nil input.
- Updates vendored goorgeous package and test for org-mode frontmatter.
- Add tests and godoc comments.

Coverage for parser package increased from 45.2% to 85.2%.
commands/import_jekyll.go
commands/new.go
commands/undraft_test.go
hugolib/page.go
parser/frontmatter.go
parser/frontmatter_test.go
parser/page.go
parser/page_test.go [new file with mode: 0644]
vendor/vendor.json