LaTeX reader: Set identifiers on Spans used for \label.

This commit is contained in:
John MacFarlane 2017-08-20 16:52:03 -07:00
parent f2fdd275fd
commit 9cc128b579
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

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