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","")]] ```