Markdown italics aren't rendering

Hello everyone. I’ve got a site built with Hugo 0.40.2 where the italics don’t render consistently. Sometimes they do, sometimes they don’t (and the underscores just appear as text), and there doesn’t appear to be any rhyme or reason to it.

Here’s a sample of the Markdown:

All else being equal, when asked to memorize a string of characters, people would be more likely to remember _“muse aims with lasting liable”_ than they would be to remember _"eg-;UJ 0-L”_.

The problem, we realized, was that this memorization was context specific. Passphrases would only perform better than letters and numbers _if_ the person knew what these random words were actually for. Did people know why they were seeing random words

Here’s how it gets rendered. Note how the first two phrases work but the “if” doesn’t.
screenshot from 2018-05-04 11 38 43

I don’t have a clue why this is happening and I don’t know where to look to solve it. The theme is very basic, nothing weird in the config, no additional options for blackfriday enabled, etc.

We’re using Forestry to create content but I don’t think that should have any effect…? Posts created in Forestry just output as regular .md files, nothing extra or unusual in the front matter.

Let me know if I can provide any more info that could lead us down the right path. This is such a basic thing, I’m sure the solution is something simple.

Worth noting:

  • using asterisks instead of underscores didn’t work
  • several other blog posts have bold words (double asterisk), and those work without issue

Blackfriday does not recognize non-breaking spaces ( ) as spaces. Try to replace the space.

1 Like

This was it. Thank you! I never would have checked that. Looks like Forestry inserts   around Markdown formatting characters – it’s doing the same with links and images. Anyway, thanks again.

That is surely a bug. Have you been able to report it?

How did you spot the  ? I still don’t see it :slight_smile:

Yep, reported to Forestry, we’ll see what happens. Forestry supports exactly two static site generators, so if it bugs out about something so trivial in one of them, that’s a big deal :smiley:

They look the same but are actually different characters. You can spot them if you search for the character in a text editor.

If you highlight the nbsp character and copy into the search field:


Right, but was there an nbsp; char in your Markdown snippet? I had copied/pasted it, and it rendered fine here.

And as for the HTML, you just pasted a screenshot, so I am wondering how @Mikhail came to that conclusion, unless of course experience :slight_smile:

Also, interesting to see that your HTML has <i> tags, whereas the HTML generated by me on using your snippet generates <em> tags.

Hmm, are we comparing the same thing?

No it’s different, sorry, took this screenshot in a rush. As a hacky fix (the post needed to go live today) I replaced all underscores with raw <i> tags, and the screenshot was taken after that change was made.

Actually I’m curious if, after this gets pushed back to Forestry, the nbsp characters will remain, or get replaced with proper spaces :thinking:

Maybe when I pasted the snippet into Github, Github’s Markdown engine converted nbsps into regular spaces! :laughing: