Permalink
Browse files

Remove leading and trailing spaces in paragraph, plain, and headers.

  • Loading branch information...
1 parent 416ec6b commit 4438c336444a714f15ed619c9897d91c3ab6b40e @jgm committed Apr 11, 2008
Showing with 3 additions and 3 deletions.
  1. +3 −3 Markdown.hs
View
6 Markdown.hs
@@ -315,9 +315,9 @@ blockToHtml :: [([Inline],(String, String))] -- ^ list of link references
-> Doc
blockToHtml refs block =
case block of
- Para xs -> inTagsSimple "p" $ wrap refs xs
- Plain xs -> wrap refs xs
- Heading lev xs -> inTagsSimple ("h" ++ show lev) $ hcat $ map (inlineToHtml refs) xs
+ Para xs -> inTagsSimple "p" $ wrap refs $ lrstrip Space xs
+ Plain xs -> wrap refs $ lrstrip Space xs
+ Heading lev xs -> inTagsSimple ("h" ++ show lev) $ hcat $ map (inlineToHtml refs) $ lrstrip Space xs
HorizontalRule -> selfClosingTag "hr" []
BlockQuote xs -> inTagsIndented "blockquote" $ vcat $ map (blockToHtml refs) xs
Verbatim s -> inTagsSimple "pre" $ inTagsSimple "code" $ P.text $ escapeStringForXML s

0 comments on commit 4438c33

Please sign in to comment.