aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]markdown/extensions/fenced_code.py2
-rw-r--r--tests/extensions/github_flavored.html9
-rw-r--r--tests/extensions/github_flavored.txt11
3 files changed, 21 insertions, 1 deletions
diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py
index 457b35d..9a1284f 100644..100755
--- a/markdown/extensions/fenced_code.py
+++ b/markdown/extensions/fenced_code.py
@@ -81,7 +81,7 @@ from markdown.extensions.codehilite import CodeHilite, CodeHiliteExtension
# Global vars
FENCED_BLOCK_RE = re.compile( \
- r'(?P<fence>^(?:~{3,}|`{3,}))[ ]*(\{?\.?(?P<lang>[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P<code>.*?)(?<=\n)(?P=fence)[ ]*$',
+ r'(?P<fence>^(?:~{3,}|`{3,}))[ ]*(\{?\.?(?P<lang>[a-zA-Z0-9_+-]*)\}?)?[ ]*\n(?P<code>.*?)(?<=\n)(?P=fence)[ ]*$',
re.MULTILINE|re.DOTALL
)
CODE_WRAP = '<pre><code%s>%s</code></pre>'
diff --git a/tests/extensions/github_flavored.html b/tests/extensions/github_flavored.html
index 42577dc..063303a 100644
--- a/tests/extensions/github_flavored.html
+++ b/tests/extensions/github_flavored.html
@@ -29,4 +29,13 @@
+ return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
+ CONTEXT_DIFF_LINE_PATTERN,
+```
+</code></pre>
+
+<p>Test support for foo+bar lexer names.</p>
+<pre><code class="html+jinja">&lt;title&gt;{% block title %}{% endblock %}&lt;/title&gt;
+&lt;ul&gt;
+{% for user in users %}
+ &lt;li&gt;&lt;a href=&quot;{{ user.url }}&quot;&gt;{{ user.username }}&lt;/a&gt;&lt;/li&gt;
+{% endfor %}
+&lt;/ul&gt;
</code></pre> \ No newline at end of file
diff --git a/tests/extensions/github_flavored.txt b/tests/extensions/github_flavored.txt
index d0737bd..4f362b7 100644
--- a/tests/extensions/github_flavored.txt
+++ b/tests/extensions/github_flavored.txt
@@ -32,3 +32,14 @@ index 0000000..6e956a9
+ CONTEXT_DIFF_LINE_PATTERN,
+```
```
+
+Test support for foo+bar lexer names.
+
+```html+jinja
+<title>{% block title %}{% endblock %}</title>
+<ul>
+{% for user in users %}
+ <li><a href="{{ user.url }}">{{ user.username }}</a></li>
+{% endfor %}
+</ul>
+```