Open vlbrown opened 5 years ago
This would be convenient, especially with the bootstrap-like colored boxes in JupyterLab, that show up nicely inside the notebooks:
I realize that it could be rewritten to use HTML tags, but I prefer to have it in markdown to be able to export to PDF when needed (even if the box is not included), and since I have scripts that parse the markdown headers.
Yes, it would be great if nbconvert
(and by extension nbviewer
) could parse those contents of HTML tags!
@joelostblom
I prefer to have it in markdown to be able to export to PDF when needed (even if the box is not included)
When using my Sphinx extension nbsphinx the boxes will also be included in PDF output, see e.g. https://nbsphinx.readthedocs.io/_/downloads/en/0.7.1/pdf/#subsection.3.8
This could possibly also be added to nbconvert
's PDF output?
For future reference: https://github.com/jupyter/notebook/issues/1292
I thought I had found gold with the discovery of the magic blank line that makes markdown within <div>
tags render on JLab for these alerts ... and then I found this deficiency in nbconvert. Strongly in support of a fix for this. Apparently a CommonMark solution has still not come about. turns out I did!
<blockquote>
This is a sentence containing some _italic_ and **bold** text.
* bullet point
* bullet point
Here's a new paragraph.
</blockquote>
I got the correct result with jupyter nbconvert --to=html
, just had to make sure I had a current version of mistune
. In the process I learned that the blank line is part of the CommonMark spec, so not "magic" after all.
Recommend closing as fixed in a dependency.
A workaround is to supply --TemplateExporter.filters="{'markdown2html': 'nbconvert.filters.markdown.markdown2html_pandoc'}"
in the call to jupyter nbconvert ...
.
Knowing little about how nbconvert works, this leads me to believe the bug is actually in the default markdown2html processor, i.e. mistune, and that pandoc interprets the CommonMark spec correctly here.
Current version of mistune
works just fine.
nbconvert to html skips Markdown within HTML tags
e.g.
nbconvert --to html will bypass the conens of that blockquote section.
(Note that if you don't put in the
</blockquote>
, Markdown still renders as a blockquote (to the end of th cell) ANDnbconvert --to html
converts properly. Apparently,nbconvert
is triggered by the closing tag, not the opening tag.