Skip to content

Commit

Permalink
Allow bold and italic markup to span multiple lines
Browse files Browse the repository at this point in the history
Fixes #61.
  • Loading branch information
Alhadis committed Apr 15, 2018
1 parent d7929b9 commit 338e20c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions grammars/restructuredtext.cson
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,21 @@ repository:
# Bold
{
name: "markup.bold.restructuredtext"
match: "(\\*\\*)[^\\*\\s][^*]*(\\*\\*)"
captures:
1: "name": "punctuation.definition.bold.restructuredtext"
2: "name": "punctuation.definition.bold.restructuredtext"
begin: "\\*\\*(?=[^\\*\\s])"
end: "\\*\\*|^(?=\\s*$)"
beginCaptures: 0: "name": "punctuation.definition.bold.begin.restructuredtext"
endCaptures: 0: "name": "punctuation.definition.bold.end.restructuredtext"
patterns: [include: "#inlines"]
}

# Italic
{
name: "markup.italic.restructuredtext"
match: "(?<!\\\\)(\\*)[^\\*\\s][^*]*(?<!\\\\)(\\*)"
captures:
1: name: "punctuation.definition.italic.restructuredtext"
2: name: "punctuation.definition.italic.restructuredtext"
begin: "(?<!\\\\)\\*(?=[^\\*\\s])"
end: "(?<!\\\\)\\*|^(?=\\s*$)"
beginCaptures: 0: name: "punctuation.definition.italic.begin.restructuredtext"
endCaptures: 0: name: "punctuation.definition.italic.end.restructuredtext"
patterns: [include: "#inlines"]
}
]

Expand All @@ -128,8 +130,8 @@ repository:
name: "markup.raw.restructuredtext"
begin: "``"
end: "``((?=[^`\\w\\d])|$)"
captures:
0: name: "punctuation.definition.raw.restructuredtext"
beginCaptures: 0: name: "punctuation.definition.raw.begin.restructuredtext"
endCaptures: 0: name: "punctuation.definition.raw.end.restructuredtext"



Expand Down

0 comments on commit 338e20c

Please sign in to comment.