Why does Sphinx+MyST put spaces inside HTML tags in the generated output?

217 views Asked by At

I'm new to MyST and Sphinx, so perhaps this has an obvious explanation, but it is not obvious to me. Whenever I use any construct in my Markdown source, such as bold facing or italics or even an html element such as <span>, the result in the formatted HTML output contains spaces inside the HTML tags. For example, an input such as

* **Barcode**: the barcode identifying the item
* **Title**: the title of the item.
* **Author**: the author of the item.

produces this:

enter image description here

Note the space before the :. Inspecting the HTML reveals that the bold-faced element contains unexpected space characters:

enter image description here

Note the spaces inside the <strong>...</strong>. Why is this happening? What am I doing wrong? More importantly, how do I make it stop?

I'm using Sphinx 3.4.3 with myst-parser 0.13.3. My conf.py defines extensions as 'myst_parser', 'sphinx.ext.autodoc', 'sphinx.ext.autosectionlabel', and 'sphinx.ext.napoleon'.

0

There are 0 answers