1
0
mirror of https://github.com/strongdm/comply synced 2024-11-21 23:24:53 +00:00

YAML front-matter delimiter support #91 (#92)

This commit is contained in:
Phillip Markert 2020-09-14 18:20:10 -04:00 committed by GitHub
parent dbe49a09b3
commit 4370d2292c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,6 +179,9 @@ func loadMDMD(path string) metadataMarkdown {
content := string(bytes)
components := strings.Split(content, "---")
if components[0] == "" && (len(components) > 1) {
components = components[1:]
}
if len(components) == 1 {
panic(fmt.Sprintf("Malformed metadata markdown in %s, must be of the form: YAML\\n---\\nmarkdown content", path))
}