Skip to content

Commit 41101dc

Browse files
grantisuwaylan
authored andcommitted
codehilite: detect languages with funny names (#527)
Extend the language regex to match things like 'C#' and 'VB.Net'.
1 parent aefad1b commit 41101dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

markdown/extensions/codehilite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def _parseHeader(self):
166166
c = re.compile(r'''
167167
(?:(?:^::+)|(?P<shebang>^[#]!)) # Shebang or 2 or more colons
168168
(?P<path>(?:/\w+)*[/ ])? # Zero or 1 path
169-
(?P<lang>[\w+-]*) # The language
169+
(?P<lang>[\w#.+-]*) # The language
170170
\s* # Arbitrary whitespace
171171
# Optional highlight lines, single- or double-quote-delimited
172172
(hl_lines=(?P<quot>"|')(?P<hl_lines>.*?)(?P=quot))?

0 commit comments

Comments
 (0)