ipython/ipython — pull request #3570 by jakobgager (2013-07-06 21:15:36+00:00)
Title: Handle raw html tags in markdown (nbconvert -> latex)

Addresses issue #3503.
Use HTMLParser to split the markdown source into
* pure markdown
* html tags
* tagged comments (starting with ##)

These are individually converted and assembled for the output creation.

Addresses a shortcoming of pandoc that raw html is removed during conversion to latex (see http://johnmacfarlane.net/pandoc/README.html#raw-html)

*Tagged comments* are just a small addition. Basically, if an html comment starts with ## it will be treated as raw input. Thus "invisible" latex commands can be injected to the notebook, which act only after conversion to latex. Can be used to include labels, references, cites, tables, etc.
e.g.: markdown -> latex
(markdown cell): `foo bar`
(notebook): `foo bar`
(latex): `foo \cite{refA} bar`