Skip to content

Accept ... as frontmatter terminator (pandoc syntax)#8

Open
noerw wants to merge 2 commits intoyuin:masterfrom
noerw:pandocsupport
Open

Accept ... as frontmatter terminator (pandoc syntax)#8
noerw wants to merge 2 commits intoyuin:masterfrom
noerw:pandocsupport

Conversation

@noerw
Copy link

@noerw noerw commented Mar 17, 2022

Pandoc for some reason accepts ... as a yaml frontmatter separator, and people actually use this.

noerw added 2 commits March 17, 2022 13:32
- needs 3 or more characters
- may not have leading spaces
func isEndSeparator(line []byte) bool {
line = util.TrimRightSpace(line)
for i := 0; i < len(line); i++ {
if line[i] != '-' && line[i] != '.' {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to accept -.- or ..- ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if line[0] != '-' || line[0] != '.' { return false }
for i := 1 ... {
    if line[i] != line[0] { return false }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants