markdown-redcarpet.tmbundle
markdown-redcarpet.tmbundle copied to clipboard
Separator (Horizontal Rules) Broken
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?
Both solutions sound good to me =)