LaTeX reader: omit visible content for \label{...}.

Previously we included the text of the label in square brackets,
but this is undesirable in many cases.

See discussion in
<https://github.com/jgm/pandoc/issues/813#issuecomment-978232426>.
This commit is contained in:
John MacFarlane 2021-11-24 14:47:00 -08:00
parent 6072bdcec9
commit 7726b69cd3
2 changed files with 2 additions and 5 deletions

View file

@ -56,8 +56,7 @@ dolabel = do
let refstr = untokenize v
updateState $ \st ->
st{ sLastLabel = Just refstr }
return $ spanWith (refstr,[],[("label", refstr)])
$ inBrackets $ str $ untokenize v
return $ spanWith (refstr,[],[("label", refstr)]) mempty
doref :: PandocMonad m => Text -> LP m Inlines
doref cls = do

View file

@ -287,9 +287,7 @@ Figure \ref{fig:Logo3} illustrated the SVG logo
\label{section} Section \ref{section}
^D
[ Para
[ Span
( "section" , [] , [ ( "label" , "section" ) ] )
[ Str "[section]" ]
[ Span ( "section" , [] , [ ( "label" , "section" ) ] ) []
, Space
, Str "Section"
, Space