"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Text/Pandoc/Readers/HTML.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.

HTML.hs  (pandoc-2.14.0.3):HTML.hs  (pandoc-2.14.1)
skipping to change at line 725 skipping to change at line 725
-- check for href; if href, then a link, otherwise a span -- check for href; if href, then a link, otherwise a span
case maybeFromAttrib "href" tag of case maybeFromAttrib "href" tag of
Nothing -> Nothing ->
return $ extractSpaces (B.spanWith (uid, cls, [])) lab return $ extractSpaces (B.spanWith (uid, cls, [])) lab
Just url' -> do Just url' -> do
url <- canonicalizeUrl url' url <- canonicalizeUrl url'
return $ extractSpaces (B.linkWith (uid, cls, []) (escapeURI url) title ) lab return $ extractSpaces (B.linkWith (uid, cls, []) (escapeURI url) title ) lab
pImage :: PandocMonad m => TagParser m Inlines pImage :: PandocMonad m => TagParser m Inlines
pImage = do pImage = do
tag <- pSelfClosing (=="img") (isJust . lookup "src") tag@(TagOpen _ attr') <- pSelfClosing (=="img") (isJust . lookup "src")
url <- canonicalizeUrl $ fromAttrib "src" tag url <- canonicalizeUrl $ fromAttrib "src" tag
let title = fromAttrib "title" tag let title = fromAttrib "title" tag
let alt = fromAttrib "alt" tag let alt = fromAttrib "alt" tag
let uid = fromAttrib "id" tag let attr = toAttr $ filter (\(k,_) -> k /= "alt" && k /= "title" && k /= "src"
let cls = T.words $ fromAttrib "class" tag ) attr'
let getAtt k = case fromAttrib k tag of return $ B.imageWith attr (escapeURI url) title (B.text alt)
"" -> []
v -> [(k, v)]
let kvs = concatMap getAtt ["width", "height", "sizes", "srcset"]
return $ B.imageWith (uid, cls, kvs) (escapeURI url) title (B.text alt)
pSvg :: PandocMonad m => TagParser m Inlines pSvg :: PandocMonad m => TagParser m Inlines
pSvg = do pSvg = do
guardDisabled Ext_raw_html guardDisabled Ext_raw_html
-- if raw_html enabled, parse svg tag as raw -- if raw_html enabled, parse svg tag as raw
opent@(TagOpen _ attr') <- pSatisfy (matchTagOpen "svg" []) opent@(TagOpen _ attr') <- pSatisfy (matchTagOpen "svg" [])
let (ident,cls,_) = toAttr attr' let (ident,cls,_) = toAttr attr'
contents <- many (notFollowedBy (pCloses "svg") >> pAny) contents <- many (notFollowedBy (pCloses "svg") >> pAny)
closet <- TagClose "svg" <$ (pCloses "svg" <|> eof) closet <- TagClose "svg" <$ (pCloses "svg" <|> eof)
let rawText = T.strip $ renderTags' (opent : contents ++ [closet]) let rawText = T.strip $ renderTags' (opent : contents ++ [closet])
 End of changes. 2 change blocks. 
8 lines changed or deleted 4 lines changed or added

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