Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Separator (Horizontal Rules) Broken #29

@michaeldough

Description

@michaeldough

commit for support-yaml-front-matter has broken language support for markdown horizontal rules (separator).

separator = {
    name = 'meta.separator.markdown';
    match = '(^|\G)[ ]{,3}([-*_])([ ]{,2}\2){2,}[ \t]*$\n?';
};
yaml_frontmatter = {
    name = 'meta.frontmatter.markdown';
    begin = '(^|\G)[ ]{,3}([-*_])([ ]{,2}\2){2,}[ \t]*$\n?';
    end = '(^|\G)[ ]{,3}([-*_])([ ]{,2}\2){2,}[ \t]*$\n?';
};

yaml_frontmatter currently matches for 3 or more *, -, _. It should be restricted to exact match of 3 dashes --- which is spec for yaml front matter. This will atleast allow the use of *** and ___ for horizontal rules, but still breaks the --- separator.

yaml_frontmatter = {
    name = 'meta.frontmatter.markdown';
    begin = '(^|\G)([-]{3})($|\z)';
    end = '(^|\G)([-]{3})($|\z)';
};

another option is matching for beginning ---yaml and ending ---. this would allow future support for other front matter languages such as ---json or ---coffee

yaml_frontmatter = {
    name = 'meta.frontmatter.markdown';
    begin = '(^|\G)([-]{3})[ ]*(?:yaml)$';
    end = '(^|\G)([-]{3})($|\z)';
};

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions