aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-03 18:25:49 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-03 18:25:49 +0000
commit21ba6b08f27838bffff457cf6adafd988615d818 (patch)
treea4c0605634b26354ba0e60d313f7c5a445e5799b /src/Text/Pandoc/Readers
parent31c030e3a55c3bc9d4a606e9658dd30a9aa1c938 (diff)
downloadpandoc-21ba6b08f27838bffff457cf6adafd988615d818.tar.gz
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
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 8ebf02c33..96244e58f 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -462,12 +462,15 @@ link = try $ do
else generateReference url title
return $ Link (normalizeSpaces label) ref
-image = try (do
+image = try $ do
(tag, attributes) <- htmlTag "img"
url <- case (extractAttribute "src" attributes) of
Just url -> do {return url}
Nothing -> fail "no src"
let title = fromMaybe "" (extractAttribute "title" attributes)
let alt = fromMaybe "" (extractAttribute "alt" attributes)
- ref <- generateReference url title
- return (Image [Str alt] ref))
+ state <- getState
+ ref <- if stateInlineLinks state
+ then return (Src url title)
+ else generateReference url title
+ return $ Image [Str alt] ref