diff options
author | Waylan Limberg <waylan@gmail.com> | 2008-09-18 22:13:46 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2008-09-18 22:13:46 -0400 |
commit | 7fdc7f9f2f5e61d6d779e07879d0b98c5635facf (patch) | |
tree | cbd5533706b1659a32ff07735b3a30277baf88e8 | |
parent | c05e63384737c7b681457842686e1544590fdb30 (diff) | |
download | markdown-7fdc7f9f2f5e61d6d779e07879d0b98c5635facf.tar.gz markdown-7fdc7f9f2f5e61d6d779e07879d0b98c5635facf.tar.bz2 markdown-7fdc7f9f2f5e61d6d779e07879d0b98c5635facf.zip |
[CodeHilite] Modified Sheband regex to match against language aliases supported by Pygments which contain + or -. Thanks David A. Krauth.
-rw-r--r-- | markdown_extensions/codehilite.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/markdown_extensions/codehilite.py b/markdown_extensions/codehilite.py index 55b9055..a96aaaa 100644 --- a/markdown_extensions/codehilite.py +++ b/markdown_extensions/codehilite.py @@ -151,10 +151,8 @@ class CodeHilite: c = re.compile(r''' (?:(?:::+)|(?P<shebang>[#]!)) # Shebang or 2 or more colons. - (?P<path>(?:/\w+)*[/ ])? # Zero or 1 path ending in either - # a / or a single space. - (?P<lang>\w*) # The language (a single / or - # space before lang is a path). + (?P<path>(?:/\w+)*[/ ])? # Zero or 1 path + (?P<lang>[\w+-]*) # The language ''', re.VERBOSE) # search first line for shebang m = c.search(fl) |