1. Luke Plant
  2. haskellblog

Commits

Luke Plant  committed 8990694

Fixed bug in plaintext filter

  • Participants
  • Parent commits 523e766
  • Branches default

Comments (0)

Files changed (2)

File src/Blog/Formats.hs

View file
 formatPlaintext s = utf8 >>>
                     escapeHtml >>>
                     normaliseCRLF >>>
+                    linkify >>>
                     nl2br >>>
-                    linkify >>>
                     preserveLeadingWhitespace >>>
                     UTF8.toString
                     $ s

File testsuite/Tests/Blog/Formats.hs

View file
 testFormatPlaintextLink3 = "<a href=\"http://foo.com/bar?what=why\">http://foo.com/bar?what=why</a> x" ~=?
                            pt "http://foo.com/bar?what=why x"
 
+testFormatPlaintextLink4 = "<a href=\"http://foo.com/\">http://foo.com/</a><br />\n" ~=?
+                           pt "http://foo.com/\n"
+
 tests = test [ testFormatPlaintext
              , testFormatPlaintextLink1
              , testFormatPlaintextLink2
-             , testFormatPlaintextLink3]
+             , testFormatPlaintextLink3
+             , testFormatPlaintextLink4
+             ]