diff --git a/src/packages/gfm.tmbundle/Syntaxes/gfm.cson b/src/packages/gfm.tmbundle/Syntaxes/gfm.cson index 379b3c436..b9c92d8e8 100644 --- a/src/packages/gfm.tmbundle/Syntaxes/gfm.cson +++ b/src/packages/gfm.tmbundle/Syntaxes/gfm.cson @@ -36,6 +36,14 @@ 'match': '\\:[^\\:\\s]+\\:' 'name': 'string.emoji.gfm' } + { + 'match': '^\\s*[\\*]{3,}\\s*$' + 'name': 'comment.hr.gfm' + } + { + 'match': '^\\s*[-]{3,}\\s*$' + 'name': 'comment.hr.gfm' + } { 'begin': '^```.*$' 'beginCaptures': diff --git a/src/packages/gfm.tmbundle/spec/gfm-spec.coffee b/src/packages/gfm.tmbundle/spec/gfm-spec.coffee index 333225194..962f172ac 100644 --- a/src/packages/gfm.tmbundle/spec/gfm-spec.coffee +++ b/src/packages/gfm.tmbundle/spec/gfm-spec.coffee @@ -13,10 +13,14 @@ describe "GitHub Flavored Markdown grammar", -> expect(grammar).toBeTruthy() expect(grammar.scopeName).toBe "source.gfm" - it "tokenizes **bold** text", -> - {tokens} = grammar.tokenizeLine("****") - expect(tokens[0]).toEqual value: "****", scopes: ["source.gfm"] + it "tokenizes horizontal rules", -> + {tokens} = grammar.tokenizeLine("***") + expect(tokens[0]).toEqual value: "***", scopes: ["source.gfm", "comment.hr.gfm"] + {tokens} = grammar.tokenizeLine("---") + expect(tokens[0]).toEqual value: "---", scopes: ["source.gfm", "comment.hr.gfm"] + + it "tokenizes **bold** text", -> {tokens} = grammar.tokenizeLine("this is **bold** text") expect(tokens[0]).toEqual value: "this is", scopes: ["source.gfm"] expect(tokens[1]).toEqual value: " ", scopes: ["source.gfm"]