Add initial support for horizontal rules

This commit is contained in:
Kevin Sawicki
2013-02-11 10:39:08 -08:00
parent 133d417cad
commit a4c147ef1c
2 changed files with 15 additions and 3 deletions

View File

@@ -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':

View File

@@ -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"]