parent
1f0ba8ec11
commit
6740a9592a
1 changed files with 6 additions and 1 deletions
|
@ -440,7 +440,7 @@ pCodeBlock :: TagParser Blocks
|
|||
pCodeBlock = try $ do
|
||||
TagOpen _ attr <- pSatisfy (~== TagOpen "pre" [])
|
||||
contents <- manyTill pAnyTag (pCloses "pre" <|> eof)
|
||||
let rawText = concatMap fromTagText $ filter isTagText contents
|
||||
let rawText = concatMap tagToString contents
|
||||
-- drop leading newline if any
|
||||
let result' = case rawText of
|
||||
'\n':xs -> xs
|
||||
|
@ -451,6 +451,11 @@ pCodeBlock = try $ do
|
|||
_ -> result'
|
||||
return $ B.codeBlockWith (mkAttr attr) result
|
||||
|
||||
tagToString :: Tag String -> String
|
||||
tagToString (TagText s) = s
|
||||
tagToString (TagOpen "br" _) = "\n"
|
||||
tagToString _ = ""
|
||||
|
||||
inline :: TagParser Inlines
|
||||
inline = choice
|
||||
[ eNoteref
|
||||
|
|
Loading…
Add table
Reference in a new issue