diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-10-21 16:09:09 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-10-21 16:09:09 -0400 |
commit | 5aad55f920ded6a30a61a8a9b90a52da48c79040 (patch) | |
tree | df12796b469649bd1b1036574466931ac3c0ac4c | |
parent | 0dc9ae0d62829a4b9856a3979c967facafc2d128 (diff) | |
download | markdown-5aad55f920ded6a30a61a8a9b90a52da48c79040.tar.gz markdown-5aad55f920ded6a30a61a8a9b90a52da48c79040.tar.bz2 markdown-5aad55f920ded6a30a61a8a9b90a52da48c79040.zip |
Fixed #153. Two spaces at end of paragraph is not a linebreak.
-rw-r--r-- | markdown/inlinepatterns.py | 2 | ||||
-rw-r--r-- | tests/misc/html.html | 3 | ||||
-rw-r--r-- | tests/misc/two-spaces.html | 6 | ||||
-rw-r--r-- | tests/safe_mode/inline-html-simple.html | 9 |
4 files changed, 6 insertions, 14 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index 285e7e5..6ec58c4 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -69,7 +69,6 @@ def build_inlinepatterns(md_instance, **kwargs): ReferencePattern(SHORT_REF_RE, md_instance) inlinePatterns["autolink"] = AutolinkPattern(AUTOLINK_RE, md_instance) inlinePatterns["automail"] = AutomailPattern(AUTOMAIL_RE, md_instance) - inlinePatterns["linebreak2"] = SubstituteTagPattern(LINE_BREAK_2_RE, 'br') inlinePatterns["linebreak"] = SubstituteTagPattern(LINE_BREAK_RE, 'br') if md_instance.safeMode != 'escape': inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance) @@ -119,7 +118,6 @@ AUTOMAIL_RE = r'<([^> \!]*@[^> ]*)>' # <me@example.com> HTML_RE = r'(\<([a-zA-Z/][^\>]*?|\!--.*?--)\>)' # <...> ENTITY_RE = r'(&[\#a-zA-Z0-9]*;)' # & LINE_BREAK_RE = r' \n' # two spaces at end of line -LINE_BREAK_2_RE = r' $' # two spaces at end of text def dequote(string): diff --git a/tests/misc/html.html b/tests/misc/html.html index c72bb81..1eb6a97 100644 --- a/tests/misc/html.html +++ b/tests/misc/html.html @@ -1,7 +1,6 @@ <h1>Block level html</h1> -<p>Some inline <b>stuff<b>.<br /> -</p> +<p>Some inline <b>stuff<b>. </p> <p>Now some <arbitrary>arbitrary tags</arbitrary>.</p> <div>More block level html.</div> diff --git a/tests/misc/two-spaces.html b/tests/misc/two-spaces.html index 102d1db..97b54b4 100644 --- a/tests/misc/two-spaces.html +++ b/tests/misc/two-spaces.html @@ -4,14 +4,12 @@ but this line has three <br /> and this is the second from last line in this test message</p> <ul> -<li>This list item has two spaces.<br /> -</li> +<li>This list item has two spaces. </li> <li> <p>This has none. This line has three. <br /> This line has none. - And this line two.<br /> -</p> + And this line two. </p> <p>This line has none.</p> </li> <li> diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html index 981c3a2..1e5df17 100644 --- a/tests/safe_mode/inline-html-simple.html +++ b/tests/safe_mode/inline-html-simple.html @@ -29,8 +29,7 @@ Blah <pre><code><!-- Comment --> </code></pre> <p>Just plain comment, with trailing spaces on the line:</p> -<p><!-- foo --> <br /> -</p> +<p><!-- foo --> </p> <p>Code:</p> <pre><code><hr /> </code></pre> @@ -38,10 +37,8 @@ Blah <p><hr></p> <p><hr/></p> <p><hr /></p> -<p><hr> <br /> -</p> -<p><hr/><br /> -</p> +<p><hr> </p> +<p><hr/> </p> <p><hr /> </p> <p><hr class="foo" id="bar" /></p> <p><hr class="foo" id="bar"/></p> |