Bold and Italics in the same text?

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

I am trying to include both bold and italics in the same senrtence.

.Now she had on a long-sleeved garment; for in this manner the virgin daughters of the king dressed themselves in robes. Then his attendant took her out and locked the door behind her.
19. Tamar put ashes on her head and tore her **long-sleeved ** garment which was on her; and she put her hand on her head and went away, crying aloud as she went
.

I tried your example with underscores for italics and asterisks for bold, and it seems to work for me.

Maybe you have a theme issue?

I also just noticed (in this forum) your first “long-sleeved” shows up as bold, but the second one does not.

I believe that’s because you have a space after **long-sleeved **

In Obsidian, it still works for me. A space before the bold text stops it from working, in my test. But to be safe, avoid spaces between the asterisks and your text.

I’m taking a guess here that your problem is that the second sentence

is not italic in Obsidian.

I think this happens because Obsidian makes this a numbered list item because of 19.
You can escape that formatting by putting a backslash ( \ ) in front of the number.

This works:

*Now she had on a **long-sleeved** garment; for in this manner the virgin daughters of the king dressed themselves in robes. Then his attendant took her out and locked the door behind her.
\19. Tamar put ashes on her head and tore her **long-sleeved** garment wich was on her; and she put her hand on her head and went away, crying aloud as she went.*

Or instead of using the backslash you could remove the space behind 19.

1 Like

It would help us if you marked the example text you posted as code by putting 3 backticks (```) or 3 tildes (~~~) on the line before it and the line after it.

I see there’s a period at the start of the first line. Whatever it’s for, you may want a space between it and the emphasis marker.

The rules for mixed emphasis and string emphasis can get surprisingly complicated. CommonMark Spec

1 Like

Markdown is only simple when you keep it simple

1 Like

Above is the text properly quoted, and I do believe @Olondre is right that the 19. is causing some issues in the live-preview mode, where there is a slight issue.

However, this text is two distinct lines, with some newline before the 19., and they tried using _ ... _ over multiple lines, which never is a good idea. So it’s not just bold and italics over multiple sentences, but over multiple lines.

Solution, is either to use backslash in front of the 19. as Olondre suggested, or to make each line italic on its own.

2 Likes

CommonMark seems to allow emphasis spanning a line break (probably not a paragraph), but I agree it’s best to avoid it (also, Obsidian’s nonstandard default rendering of line breaks may interfere). I’d emphasize each line separately as holroy suggests.

I’m not sure if the “19.” counts as a list item — if there’s an “18” (or other number) before the period that starts the first line, then it does. But if not, it shouldn’t. But even if it’s not it might affect the highlighting in Live Preview and mess things up (for another case where that happens, see text inside single brackets).

1 Like

I tested it in the sandbox vault, the 19.<space> is formatted as a list item, because of the linebreak before. I think this is normal behaviour. I did not have the period on the first line in my text.

You’re right about the emphasis spanning a line break but not a paragraph, that’s something to keep in mind. Best to use emphasis on a line basis as @holroy suggested.

You’re right — I forgot we can interrupt a paragraph with a list.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.