Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

- 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