@@ -144,7 +144,7 @@ parseBodyChild e =
144144-- | Parse a @\<binary>@ element.
145145parseBinaryElement :: PandocMonad m => Element -> FB2 m ()
146146parseBinaryElement 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
148148 (Nothing, _) -> throwError $ PandocParseError "<binary> element must have an \"id\" attribute"
149149 (Just _, Nothing) -> throwError $ PandocParseError "<binary> element must have a \"content-type\" attribute"
150150 (Just filename, contentType) -> insertMedia filename contentType (decodeLenient (pack (strContent e)))
@@ -187,9 +187,9 @@ parseImageElement e =
187187 case href of
188188 Just src -> pure $ para $ imageWith (imgId, [], []) (removeHash src) title alt
189189 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: image without href."
190− where alt = maybe mempty str $ findAttr (QName "alt" Nothing Nothing) e
191− title = fromMaybe "" $ findAttr (QName "title" Nothing Nothing) e
192− imgId = fromMaybe "" $ findAttr (QName "id" Nothing Nothing) e
190+ where alt = maybe mempty str $ findAttr (unqual "alt") e
191+ title = fromMaybe "" $ findAttr (unqual "title") e
192+ imgId = fromMaybe "" $ findAttr (unqual "id") e
193193 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e
194194
195195-- | Parse @pType@
@@ -247,7 +247,7 @@ parseStanzaChild e =
247247parseEpigraph :: PandocMonad m => Element -> FB2 m Blocks
248248parseEpigraph e =
249249 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
251251
252252parseEpigraphChild :: PandocMonad m => Element -> FB2 m Blocks
253253parseEpigraphChild e =
@@ -279,7 +279,7 @@ parseSection :: PandocMonad m => Element -> FB2 m Blocks
279279parseSection e = do
280280 n <- gets fb2SectionLevel
281281 modify $ \st -> st{ fb2SectionLevel = n + 1 }
282− let sectionId = fromMaybe "" $ findAttr (QName "id" Nothing Nothing) e
282+ let sectionId = fromMaybe "" $ findAttr (unqual "id") e
283283 bs <- divWith (sectionId, ["section"], []) . mconcat <$> mapM parseSectionChild (elChildren e)
284284 modify $ \st -> st{ fb2SectionLevel = n }
285285 pure bs
@@ -309,7 +309,7 @@ parseNamedStyle :: PandocMonad m => Element -> FB2 m Inlines
309309parseNamedStyle e = do
310310 content <- mconcat <$> mapM parseNamedStyleChild (elContent e)
311311 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
313313 Just name -> pure $ spanWith ("", [name], lang) content
314314 Nothing -> throwError $ PandocParseError "Couldn't parse FB2 file: link without required name."
315315
@@ -382,5 +382,5 @@ parseInlineImageElement e =
382382 case href of
383383 Just src -> pure $ imageWith ("", [], []) (removeHash src) "" alt
384384 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
386386 href = findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e