Add comments to metadata

Closes # 17
This commit is contained in:
Sasha Koshka 2024-12-12 03:13:14 -05:00
parent 67d4f8a10a
commit da7b3ad950
2 changed files with 4 additions and 1 deletions

View File

@ -48,7 +48,8 @@ func ParseMeta (input string) (Meta, error) {
meta := make(Meta)
for _, line := range strings.Split(input, "\n") {
line = strings.TrimSpace(line)
if line == "" { continue }
if line == "" { continue }
if strings.HasPrefix(line, "#") { continue }
key, value, ok := strings.Cut(line, ":")
if !ok {
return nil, ErrMetaMalformed

View File

@ -20,6 +20,8 @@ FOO: baR
Shouldn't break anything: ---
this : that
# a comment
#also a comment
Sentence: ` + quickBrownFox + `
---
` + correctBody)