jgm/pandoc — pull request #961 by nougad (2013-08-22 18:23:24+00:00)
Title: Write id for code block to label attr in latex when listing is used

The code:

~~~{#test}
asdf
~~~

gets compiled to html:

asdf

So it is possible to link to the identifier `test`

But this doesn't happen on latex

When using the listings package (`--listings`) it is possible to set the
identifier using the `label=test` property:

\begin{lstlisting}[label=id]
hi
\end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.