aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--markdown.py2
-rw-r--r--tests/misc/headers.html4
-rw-r--r--tests/misc/headers.txt2
4 files changed, 9 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 0d20b64..2ac1b58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
*.pyc
+*.bak
+*.tmp
+tmp/*
diff --git a/markdown.py b/markdown.py
index acab09a..3348acc 100644
--- a/markdown.py
+++ b/markdown.py
@@ -1295,7 +1295,7 @@ class CorePatterns:
"""
patterns = {
- 'header': r'(#*)([^#]*)(#*)', # # A title
+ 'header': r'(#{1,6})[ \t]*(.*?)[ \t]*(#*)', # # A title
'reference-def': r'(\ ?\ ?\ ?)\[([^\]]*)\]:\s*([^ ]*)(.*)',
# [Google]: http://www.google.com/
'containsline': r'([-]*)$|^([=]*)', # -----, =====, etc.
diff --git a/tests/misc/headers.html b/tests/misc/headers.html
index 61bc266..7041eda 100644
--- a/tests/misc/headers.html
+++ b/tests/misc/headers.html
@@ -7,4 +7,6 @@
<h1><a href="http://some.link.com/">Markdown</a></h1>
-<h1>[5]: http://foo.com/</h1> \ No newline at end of file
+<h1>[5]: http://foo.com/</h1>
+
+<h1>Issue #1: Markdown</h1>
diff --git a/tests/misc/headers.txt b/tests/misc/headers.txt
index 1cb9bc0..2ddb391 100644
--- a/tests/misc/headers.txt
+++ b/tests/misc/headers.txt
@@ -7,3 +7,5 @@ Line 3
# [Markdown](http://some.link.com/)
# [5]: http://foo.com/
+
+# Issue #1: Markdown