diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs index 98cf5bdf5..2dee2bab3 100644 --- a/src/Text/Pandoc/Readers/JATS.hs +++ b/src/Text/Pandoc/Readers/JATS.hs @@ -460,7 +460,10 @@ parseRef e = do x -> x) :) . catMaybes <$> mapM (refElement c) (elChildren c) Nothing -> pure [] -- TODO handle mixed-citation - return $ Map.fromList (("id", toMetaValue $ attrValue "id" e) : refVariables) + -- allows round-tripping, since JATS writer puts ref- in front of citation ids: + let stripPref t = fromMaybe t $ T.stripPrefix "ref-" t + return $ Map.fromList (("id", toMetaValue $ stripPref $ attrValue "id" e) + : refVariables) textContent :: Element -> Text textContent = strContent