@@ -144,7 +144,7 @@ parseBodyChild e =
144-- | Parse a @\<binary>@ element.
144-- | Parse a @\<binary>@ element.
145parseBinaryElement :: PandocMonad m => Element -> FB2 m ()
145parseBinaryElement :: PandocMonad m => Element -> FB2 m ()
146parseBinaryElement e =
146parseBinaryElement e =
147− case (findAttr (QName "id" Nothing Nothing) e, findAttr (QName "content-type" Nothing Nothing) e) of
147+ case (findAttr (unqual "id") e, findAttr (unqual "content-type") e) of
148 (Nothing, _) -> throwError $ PandocParseError "<binary> element must have an \"id\" attribute"
148 (Nothing, _) -> throwError $ PandocParseError "<binary> element must have an \"id\" attribute"
149 (Just _, Nothing) -> throwError $ PandocParseError "<binary> element must have a \"content-type\" attribute"
149 (Just _, Nothing) -> throwError $ PandocParseError "<binary> element must have a \"content-type\" attribute"
150 (Just filename, contentType) -> insertMedia filename contentType (decodeLenient (pack (strContent e)))
150 (Just filename, contentType) -> insertMedia filename contentType (decodeLenient (pack (strContent e)))
@@ -187,9 +187,9 @@ parseImageElement e =
187 case href of
187 case href of
188 Just src -> pure $ para $ imageWith (imgId, [], []) (removeHash src) title alt
188 Just src -> pure $ para $ imageWith (imgId, [], []) (removeHash src) title alt
189 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: image without href."
189 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: image without href."
190− where alt = maybe mempty str $ findAttr (QName "alt" Nothing Nothing) e
190+ where alt = maybe mempty str $ findAttr (unqual "alt") e
191− title = fromMaybe "" $ findAttr (QName "title" Nothing Nothing) e
191+ title = fromMaybe "" $ findAttr (unqual "title") e
192− imgId = fromMaybe "" $ findAttr (QName "id" Nothing Nothing) e
192+ imgId = fromMaybe "" $ findAttr (unqual "id") e
193 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e
193 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e
195-- | Parse @pType@
195-- | Parse @pType@
@@ -247,7 +247,7 @@ parseStanzaChild e =
247parseEpigraph :: PandocMonad m => Element -> FB2 m Blocks
247parseEpigraph :: PandocMonad m => Element -> FB2 m Blocks
248parseEpigraph e =
248parseEpigraph e =
249 divWith (divId, ["epigraph"], []) . mconcat <$> mapM parseEpigraphChild (elChildren e)
249 divWith (divId, ["epigraph"], []) . mconcat <$> mapM parseEpigraphChild (elChildren e)
250− where divId = fromMaybe "" $ findAttr (QName "id" Nothing Nothing) e
250+ where divId = fromMaybe "" $ findAttr (unqual "id") e
252parseEpigraphChild :: PandocMonad m => Element -> FB2 m Blocks
252parseEpigraphChild :: PandocMonad m => Element -> FB2 m Blocks
253parseEpigraphChild e =
253parseEpigraphChild e =
@@ -279,7 +279,7 @@ parseSection :: PandocMonad m => Element -> FB2 m Blocks
279parseSection e = do
279parseSection e = do
280 n <- gets fb2SectionLevel
280 n <- gets fb2SectionLevel
281 modify $ \st -> st{ fb2SectionLevel = n + 1 }
281 modify $ \st -> st{ fb2SectionLevel = n + 1 }
282− let sectionId = fromMaybe "" $ findAttr (QName "id" Nothing Nothing) e
282+ let sectionId = fromMaybe "" $ findAttr (unqual "id") e
283 bs <- divWith (sectionId, ["section"], []) . mconcat <$> mapM parseSectionChild (elChildren e)
283 bs <- divWith (sectionId, ["section"], []) . mconcat <$> mapM parseSectionChild (elChildren e)
284 modify $ \st -> st{ fb2SectionLevel = n }
284 modify $ \st -> st{ fb2SectionLevel = n }
@@ -309,7 +309,7 @@ parseNamedStyle :: PandocMonad m => Element -> FB2 m Inlines
309parseNamedStyle e = do
309parseNamedStyle e = do
310 content <- mconcat <$> mapM parseNamedStyleChild (elContent e)
310 content <- mconcat <$> mapM parseNamedStyleChild (elContent e)
311 let lang = maybeToList $ ("lang",) <$> findAttr (QName "lang" Nothing (Just "xml")) e
311 let lang = maybeToList $ ("lang",) <$> findAttr (QName "lang" Nothing (Just "xml")) e
312− case findAttr (QName "name" Nothing Nothing) e of
312+ case findAttr (unqual "name") e of
313 Just name -> pure $ spanWith ("", [name], lang) content
313 Just name -> pure $ spanWith ("", [name], lang) content
314 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: link without required name."
314 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: link without required name."
@@ -382,5 +382,5 @@ parseInlineImageElement e =
382 case href of
382 case href of
383 Just src -> pure $ imageWith ("", [], []) (removeHash src) "" alt
383 Just src -> pure $ imageWith ("", [], []) (removeHash src) "" alt
384 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: inline image without href."
384 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: inline image without href."
385− where alt = maybe mempty str $ findAttr (QName "alt" Nothing Nothing) e
385+ where alt = maybe mempty str $ findAttr (unqual "alt") e
386 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e
386 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e