From 5aad55f920ded6a30a61a8a9b90a52da48c79040 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sun, 21 Oct 2012 16:09:09 -0400 Subject: Fixed #153. Two spaces at end of paragraph is not a linebreak. --- markdown/inlinepatterns.py | 2 -- tests/misc/html.html | 3 +-- tests/misc/two-spaces.html | 6 ++---- 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'<([^> \!]*@[^> ]*)>' # 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 @@

Block level html

-

Some inline stuff.
-

+

Some inline stuff.

Now some arbitrary tags.

More block level html.
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
and this is the second from last line in this test message

    -
  • This list item has two spaces.
    -
  • +
  • This list item has two spaces.
  • This has none. This line has three.
    This line has none. - And this line two.
    -

    + And this line two.

    This line has none.

  • 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
    <!-- Comment -->
     

    Just plain comment, with trailing spaces on the line:

    -

    <!-- foo -->
    -

    +

    <!-- foo -->

    Code:

    <hr />
     
    @@ -38,10 +37,8 @@ Blah

    <hr>

    <hr/>

    <hr />

    -

    <hr>
    -

    -

    <hr/>
    -

    +

    <hr>

    +

    <hr/>

    <hr />

    <hr class="foo" id="bar" />

    <hr class="foo" id="bar"/>

    -- cgit v1.2.3