@@ -26,7 +26,7 @@ module Text.Pandoc.Readers.HTML ( readHtml
2626
2727import Control.Applicative ((<|>))
2828import Control.Monad (guard, msum, mzero, unless, void)
29−import Control.Monad.Except (throwError)
29+import Control.Monad.Except (throwError, catchError)
3030import Control.Monad.Reader (ask, asks, lift, local, runReaderT)
3131import Data.ByteString.Base64 (encode)
3232import Data.Char (isAlphaNum, isLetter)
@@ -393,11 +393,17 @@ pIframe = try $ do
393393 tag <- pSatisfy (tagOpen (=="iframe") (isJust . lookup "src"))
394394 pCloses "iframe" <|> eof
395395 url <- canonicalizeUrl $ fromAttrib "src" tag
396− (bs, _) <- openURL url
397− let inp = UTF8.toText bs
398− opts <- readerOpts <$> getState
399− Pandoc _ contents <- readHtml opts inp
400− return $ B.divWith ("",["iframe"],[]) $ B.fromList contents
396+ if T.null url
397+ then ignore $ renderTags' [tag, TagClose "iframe"]
398+ else catchError
399+ (do (bs, _) <- openURL url
400+ let inp = UTF8.toText bs
401+ opts <- readerOpts <$> getState
402+ Pandoc _ contents <- readHtml opts inp
403+ return $ B.divWith ("",["iframe"],[]) $ B.fromList contents)
404+ (\e -> do
405+ logMessage $ CouldNotFetchResource url (renderError e)
406+ ignore $ renderTags' [tag, TagClose "iframe"])
401407
402408pRawHtmlBlock :: PandocMonad m => TagParser m Blocks
403409pRawHtmlBlock = do