markdown-redcarpet.tmbundle icon indicating copy to clipboard operation
markdown-redcarpet.tmbundle copied to clipboard

Separator (Horizontal Rules) Broken

Open michaeldough opened this issue 10 years ago • 1 comments

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?

michaeldough avatar Jun 16 '15 02:06 michaeldough

Both solutions sound good to me =)

lcolladotor avatar Jul 22 '15 16:07 lcolladotor