aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-20 16:52:03 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-20 16:52:03 -0700
commit9cc128b5790437bacbda839d8ea49bd7f74ee118 (patch)
treef75661e4b3cefce0162aa18520ff6ad5ec8c1d71
parentf2fdd275fd44b4992d5ae3736c3f28deec700ba8 (diff)
downloadpandoc-9cc128b5790437bacbda839d8ea49bd7f74ee118.tar.gz
LaTeX reader: Set identifiers on Spans used for \label.
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs3
-rw-r--r--test/command/refs.md2
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","")]]
```