use urlify more in Html.lhs
authoradam <adam@megacz.com>
Wed, 28 Jan 2009 22:05:25 +0000 (14:05 -0800)
committeradam <adam@megacz.com>
Wed, 28 Jan 2009 22:05:25 +0000 (14:05 -0800)
darcs-hash:20090128220525-5007d-540d2b934f027352c0ed4e5477ef70ed96acc509.gz

src/Html.lhs

index 5784cb5..a3ff54f 100644 (file)
@@ -183,8 +183,9 @@ instance ToHtml Paragraph where
  toHtml (P t)          = stag "p"  $ toHtml t
 
 
-link ref body = "<a href='"++ref++"'>"++icon++body++"</a>"
+link ref body = "<a href='"++(urlify ref)++"'>"++icon++body++"</a>"
  where
+  urlify = toHtml
   icon = if      ".pdf" `isSuffixOf` ref then "<img "++img++" src='"++pdfIconBase64++"'>&nbsp;"
          else if "mailto:" `isPrefixOf` ref then "<img "++img++" src='"++emailIconBase64++"'>&nbsp;"
          else ""