From 9cc128b5790437bacbda839d8ea49bd7f74ee118 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 20 Aug 2017 16:52:03 -0700 Subject: LaTeX reader: Set identifiers on Spans used for \label. --- src/Text/Pandoc/Readers/LaTeX.hs | 3 ++- test/command/refs.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 56eb85064..3292550b2 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1575,7 +1575,8 @@ treatAsInline = Set.fromList dolabel :: PandocMonad m => LP m Inlines dolabel = do v <- braced - return $ spanWith ("",[],[("label", toksToString v)]) + let refstr = toksToString v + return $ spanWith (refstr,[],[("label", refstr)]) $ inBrackets $ str $ toksToString v doref :: PandocMonad m => String -> LP m Inlines diff --git a/test/command/refs.md b/test/command/refs.md index 78af1ebdd..66959e5c3 100644 --- a/test/command/refs.md +++ b/test/command/refs.md @@ -50,5 +50,5 @@ Figure \ref{fig:Logo} illustrated the SVG logo % pandoc -f latex -t native \label{section} Section \ref{section} ^D -[Para [Span ("",[],[("label","section")]) [Str "[section]"],Space,Str "Section",Space,Link ("",[],[("reference-type","ref"),("reference","section")]) [Str "[section]"] ("#section","")]] +[Para [Span ("section",[],[("label","section")]) [Str "[section]"],Space,Str "Section",Space,Link ("",[],[("reference-type","ref"),("reference","section")]) [Str "[section]"] ("#section","")]] ``` -- cgit v1.2.3