mirror of
https://github.com/atom/atom.git
synced 2026-01-27 07:47:58 -05:00
Add initial support for horizontal rules
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user