Fix "hugo new" EOF error with an archetype file without the final EOL

This rewrites `extractFrontMatterDelims` function to make it work with
an archetype file without the final EOL and adds more detailed error
messages and comments.

It also removes `matches` and `matches_quick` functions which aren't
called anywhere.
This commit is contained in:
Tatsushi Demachi
2015-01-10 16:15:51 +09:00
committed by bep
parent b6ab661893
commit 78e9229c52
3 changed files with 70 additions and 81 deletions

View File

@@ -447,7 +447,7 @@ func TestDegenerateInvalidFrontMatterShortDelim(t *testing.T) {
r string
err string
}{
{INVALID_FRONT_MATTER_SHORT_DELIM_ENDING, "Unable to read frontmatter at filepos 45: EOF"},
{INVALID_FRONT_MATTER_SHORT_DELIM_ENDING, "unable to read frontmatter at filepos 45: EOF"},
}
for _, test := range tests {