markdown-it-py icon indicating copy to clipboard operation
markdown-it-py copied to clipboard

Italics and Bold are being renders on their own HTML line

Open minchinweb opened this issue 8 months ago • 0 comments

Describe the bug

I'm using the package to render Markdown, but it puts italic, bold, and links on their own line. Normally, that's not a huge problem, but it renders a space on either side. So when the word in next to punctuation, there's an extra space.

Is there a way to turn it off? It doesn't seem to do this on the demo site.

Examples:

[Yesterday](../../journal/2025/06/2025-06-05.md), I sat next

gets rendered (ignore the link target change) as:

<p>
   <a href="http://xxx.lan/posts/2025/6/5/today-june-5-2025/">
    Yesterday
   </a>
   , I sat next

and looks like this (notice the extra space between "yesterday" and the comma):

Image

The source code of the Python code I'm using is here --> https://github.com/minchinweb/minchin.pelican.readers.commonmark/blob/ca41912fc12c4fb2b395679451f5e198d24b9385/minchin/pelican/readers/commonmark/reader.py#L49

Reproduce the bug

Check out the code here, I'm not sure why it's different from what's presented in the documentation https://github.com/minchinweb/minchin.pelican.readers.commonmark/blob/ca41912fc12c4fb2b395679451f5e198d24b9385/minchin/pelican/readers/commonmark/reader.py#L49

List your environment

  • markdown-it-py v3.0.0
  • mdit-py-plugins v0.4.2
  • minchin.pelican.readers.commonmark v2.0.2
  • Python 3.12.10
  • Windows 10

minchinweb avatar Jun 08 '25 01:06 minchinweb