diff --git a/src/MdToHTML.hs b/src/MdToHTML.hs index 2bcb34e..dea69a6 100644 --- a/src/MdToHTML.hs +++ b/src/MdToHTML.hs @@ -58,7 +58,7 @@ instance Show MdToken where show (Header level token) = "" ++ show token ++ "" show (Para token) = "

" ++ show token ++ "

" show (Line tokens) = concatMap show tokens - show Linebreak = "
\n" + show Linebreak = "
" show SingleNewline = " " show HorizontalRule = "
" show (Blockquote tokens) = "
" ++ concatMap show tokens ++ "
" @@ -81,6 +81,8 @@ instance Show MdToken where prettyPrint :: MdToken -> String prettyPrint (Para token) = "

" ++ T.unpack (wrapText defaultWrapSettings 70 (T.pack $ prettyPrint token)) ++ "

\n" prettyPrint (Table (thead : tokenGrid)) = "\n\n\n" ++ concatMap (\x -> "\n") thead ++ "\n\n" ++ "\n" ++ concatMap (\x -> "\n" ++ concatMap (\y -> "\n") x ++ "\n") tokenGrid ++ "\n
" ++ rstrip (prettyPrint x) ++ "
" ++ rstrip (prettyPrint y) ++ "
\n" +prettyPrint Linebreak = "
\n" +prettyPrint (Line tokens) = concatMap prettyPrint tokens prettyPrint (Document tokens) = concatMap prettyPrint tokens prettyPrint token = show token