Markdown code for color and bold not working together

Once you’ve done the above, delete everything above this line.

Steps to reproduce

In Live Preview, I put some color for a group of text, by using Markdown.
Simple example:

<span style="color:blue;">This is blue</span>. 
I would like to have also bold or italics for this text along with
the color. But this is not possible.
Examples which did not work:
**<span style="color:blue;">This is blue</span>**
<span style="color:blue;">**This is blue**</span>

Expected result

In Live Preview, it should be possible to see the text in the
specified color and also bold.

Actual result

For this example: **<span style="color:blue;">This is blue</span>**
the result was simply the text in blue and nothing else.

For the next example: <span style="color:blue;">**This is blue**</span>
the result was the text in blue along with the asterisks.

Environment

  • Operating system: Windows 11
  • Debug info: Obsidian version: v1.1.9
    Installer version: v1.1.9
    Operating system: Windows 10 Home 10.0.22621
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 3
    Plugins enabled: 1
    1: Multi-line Formatting v0.4.1

Additional information

This isn’t a bug. You’re trying to mix Markdown and html, and generally that doesn’t work.

If you want bold text, you’d have to use html, such as font-weight:bold; inside your html tags.

I edited your post. When you’re posting Markdown or html syntax, make sure to surround it with backticks to put it inside a code block. Otherwise we can’t read it.

<span style="color:blue; font-weight:bold">This is blue</span>

1 Like

If you you want your HTML to be semantic (I’m guessing you don’t care, but FYI), you can use <strong> for strong emphasis (rendered in bold by default) or <b> for stuff that’s bold for some other reason (“in a different voice”).

1 Like

Thank you for your reply. I am new in Markdown, so was not aware that I was mixing html with Markdown.
I am not sure how it happened. But I find that after a Windows 11 OS update and without any restart, it is now working. Both the examples that I have stated here are working. So I have both color and bold for the same text. It is also working for color and italics for the same text.

This topic was automatically closed after 11 days. New replies are no longer allowed.