aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 5627e4ee1..6b96460e8 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -111,13 +111,12 @@ parseLaTeX = do
return $ Pandoc meta bs'
resolveRefs :: M.Map String [Inline] -> Inline -> Inline
-resolveRefs labels x@(Span (ident,classes,kvs) _) =
+resolveRefs labels x@(Link (ident,classes,kvs) _ _) =
case (lookup "reference-type" kvs,
lookup "reference" kvs) of
(Just "ref", Just lab) ->
case M.lookup lab labels of
- Just txt -> Span (ident,classes,kvs)
- [Link nullAttr txt ('#':lab, "")]
+ Just txt -> Link (ident,classes,kvs) txt ('#':lab, "")
Nothing -> x
_ -> x
resolveRefs _ x = x
@@ -1538,9 +1537,11 @@ doref :: PandocMonad m => String -> LP m Inlines
doref cls = do
v <- braced
let refstr = toksToString v
- return $ spanWith ("",[],[ ("reference-type", cls)
+ return $ linkWith ("",[],[ ("reference-type", cls)
, ("reference", refstr)])
- $ inBrackets $ str refstr
+ ('#':refstr)
+ ""
+ (inBrackets $ str refstr)
lookupListDefault :: (Show k, Ord k) => v -> [k] -> M.Map k v -> v
lookupListDefault d = (fromMaybe d .) . lookupList