diff --git a/src/MdToHTML.hs b/src/MdToHTML.hs index 8911fdb..2bcb34e 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 = "
" + show Linebreak = "
\n" show SingleNewline = " " show HorizontalRule = "
" show (Blockquote tokens) = "
" ++ concatMap show tokens ++ "
" @@ -224,11 +224,17 @@ parseLink = do -- Parse a linebreak character parseLinebreak :: Parser MdToken -parseLinebreak = do - char ' ' - some (char ' ') - char '\n' - return Linebreak +parseLinebreak = parseLinebreakSpace <|> parseLinebreakBackslash + where + parseLinebreakSpace = do + char ' ' + some (char ' ') + char '\n' + return Linebreak + parseLinebreakBackslash = try $ do + char '\\' + char '\n' + return Linebreak parseTableRow :: Parser [MdToken] parseTableRow = do