Bug when italics are applied to bold text that has a space

Steps to reproduce

  1. Start with this text in a note: **Hello** World
  2. Select All
  3. Hit the keyboard shortcut for Italics (e.g. ⌘I)

Expected result

_**Hello** World_

Actual result

***Hello** World*

Screenshot

Environment

  • Operating system: macOS 12.0.1
  • Obsidian version: 0.13.0

The actual result is correct. It’s the preview that is wrong.

Hmm, that’s true. Ok, well - still a bug I guess?

Looks like an upstream (codemirror) thing. So I guess it’s a wontfix.

Well, if it “works” by using underscores for italics, how about just having Obsidian use that instead of *s?

This is not a code mirror problem. The editor is looking fine in your screenshot. The problem is in the preview.

I’m not sure that Obsidian is alone is previewing emphasis incorrectly where the pairing is split in this way. See e.g. Markdown Live Preview.

I can’t find any reference but perhaps the markdown spec is unclear on what to do with these cases.

But it’s a simple enough workaround as your own example made clear. You manually insert underscores in place of single asterisks for the italics.

The GitHub link is, I think, a red herring since it refers to a different case, where a space intervenes before a closing bold (or italic).