"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Text/Pandoc/Readers/Markdown.hs" between
pandoc-2.14.0.3.tar.gz and pandoc-2.14.1.tar.gz

About: Pandoc converts files from one markup format into another.

Markdown.hs  (pandoc-2.14.0.3):Markdown.hs  (pandoc-2.14.1)
skipping to change at line 1121 skipping to change at line 1121
many1 ((<>) <$> rawLaTeXBlock <*> spnl')) many1 ((<>) <$> rawLaTeXBlock <*> spnl'))
return $ case B.toList result of return $ case B.toList result of
[RawBlock _ cs] [RawBlock _ cs]
| T.all (`elem` [' ','\t','\n']) cs -> return mempty | T.all (`elem` [' ','\t','\n']) cs -> return mempty
-- don't create a raw block for suppressed macro defs -- don't create a raw block for suppressed macro defs
_ -> return result _ -> return result
rawHtmlBlocks :: PandocMonad m => MarkdownParser m (F Blocks) rawHtmlBlocks :: PandocMonad m => MarkdownParser m (F Blocks)
rawHtmlBlocks = do rawHtmlBlocks = do
(TagOpen tagtype _, raw) <- htmlTag isBlockTag (TagOpen tagtype _, raw) <- htmlTag isBlockTag
let selfClosing = "/>" `T.isSuffixOf` raw
-- we don't want '<td> text' to be a code block: -- we don't want '<td> text' to be a code block:
skipMany spaceChar skipMany spaceChar
indentlevel <- (blankline >> length <$> many (char ' ')) <|> return 0 indentlevel <- (blankline >> length <$> many (char ' ')) <|> return 0
-- try to find closing tag -- try to find closing tag
-- we set stateInHtmlBlock so that closing tags that can be either block or -- we set stateInHtmlBlock so that closing tags that can be either block or
-- inline will not be parsed as inline tags -- inline will not be parsed as inline tags
oldInHtmlBlock <- stateInHtmlBlock <$> getState oldInHtmlBlock <- stateInHtmlBlock <$> getState
updateState $ \st -> st{ stateInHtmlBlock = Just tagtype } updateState $ \st -> st{ stateInHtmlBlock = Just tagtype }
let closer = htmlTag (~== TagClose tagtype) let closer = htmlTag (~== TagClose tagtype)
let block' = try $ do let block' = try $ do
gobbleAtMostSpaces indentlevel gobbleAtMostSpaces indentlevel
notFollowedBy' closer notFollowedBy' closer
block block
contents <- mconcat <$> many block' contents <- if selfClosing
then return mempty
else mconcat <$> many block'
result <- result <-
try try
(do gobbleAtMostSpaces indentlevel (do gobbleAtMostSpaces indentlevel
(_, rawcloser) <- closer (_, rawcloser) <- closer
return (return (B.rawBlock "html" $ stripMarkdownAttribute raw) <> return (return (B.rawBlock "html" $ stripMarkdownAttribute raw) <>
contents <> contents <>
return (B.rawBlock "html" rawcloser))) return (B.rawBlock "html" rawcloser)))
<|> return (return (B.rawBlock "html" raw) <> contents) <|> return (return (B.rawBlock "html" raw) <> contents)
updateState $ \st -> st{ stateInHtmlBlock = oldInHtmlBlock } updateState $ \st -> st{ stateInHtmlBlock = oldInHtmlBlock }
return result return result
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)