From 7fdc7f9f2f5e61d6d779e07879d0b98c5635facf Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 18 Sep 2008 22:13:46 -0400 Subject: [CodeHilite] Modified Sheband regex to match against language aliases supported by Pygments which contain + or -. Thanks David A. Krauth. --- markdown_extensions/codehilite.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'markdown_extensions/codehilite.py') 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 or 2 or more colons. - (?P(?:/\w+)*[/ ])? # Zero or 1 path ending in either - # a / or a single space. - (?P\w*) # The language (a single / or - # space before lang is a path). + (?P(?:/\w+)*[/ ])? # Zero or 1 path + (?P[\w+-]*) # The language ''', re.VERBOSE) # search first line for shebang m = c.search(fl) -- cgit v1.2.3