Open akhmerov opened 5 years ago
I have this issue too. A bit of research led me to discover that only void elements are allowed to be in this short form, and <a>
is not a void element, which means this is not producing valid HTML.
Looking at https://github.com/jupyter/nbconvert/blob/275f7f909a803560e2459642a539874113fba959/nbconvert/filters/strings.py#L94 I wonder whether checking for an empty string and returning the unmodified html would work here — I don't fully understand the format of what's returned by this function to know whether that would break things or not.
I've got the same problem. However, after converting the jupyter notebook to HTML, I transform the HTML file to PDF. That's where I face the problem with ¶ (pilcrow).
I created a config.py file that contains the following code:
c = get_config()
c.HTMLExporter.anchor_link_text = ' ' # not empty, but a simple space!
Convert the notebook to HTML:
jupyter nbconvert --no-input my_notebook.ipynb --to html --config config.py
Then, transform HTML to PDF
pandoc my_notebook.html -o my_pdf_notebook.pdf -V fontsize=12pt -V geometry:a3paper -V geometry:margin=1in --metadata=title="" --toc
To reproduce on nbconvert 5.4 create a notebook with a single markdown cell that has following contents:
Then execute
jupyter nbconvert --to html test.ipynb --HTMLExporter.anchor_link_text=""
Inspect the output and observe that the "main text" is not visible (see image below), and the resulting html is
I believe the short-form of the
a
tag is causing the problem.NB: Is there an alternative way to turn off the anchor links?