git.iko.soy/typeable/pandoc
on master help sign in
Made image parsing in HTML reader sensitive to the

--inline-links option. git-svn-id: https://pandoc.googlecode.com/svn/trunk@556 788f1e2b-df1e-0410-8736-df70ead52e1b

commit21ba6b08f27838bffff457cf6adafd988615d818 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 3 Mar 2007, 18:25 (20 years ago) parent31c030e
1 file changed+6−3
src/Text/Pandoc/Readers/HTML.hs+6−3
src/Text/Pandoc/Readers/HTML.hs+6−3
@@ -462,12 +462,15 @@ link = try $ do
462462 else generateReference url title
463463 return $ Link (normalizeSpaces label) ref
464464
465−image = try (do
465+image = try $ do
466466 (tag, attributes) <- htmlTag "img"
467467 url <- case (extractAttribute "src" attributes) of
468468 Just url -> do {return url}
469469 Nothing -> fail "no src"
470470 let title = fromMaybe "" (extractAttribute "title" attributes)
471471 let alt = fromMaybe "" (extractAttribute "alt" attributes)
472− ref <- generateReference url title
473− return (Image [Str alt] ref))
472+ state <- getState
473+ ref <- if stateInlineLinks state
474+ then return (Src url title)
475+ else generateReference url title
476+ return $ Image [Str alt] ref