Markdown rendering not working when HTML is present in the same paragraph

Steps to reproduce

Write the following paragraph:
<div class=“some-class”>Text</div> and some extra text. Maybe some _italics_ and some bold things **because why not**.

Expected result

I expect the preview text to look like the following:
Text and some extra text. Maybe some italics and some bold things because why not.

Actual result

While the HTML element is present within the text, the italics and bold characters (_, **) get interpreted as actual text instead of the markdown characters they represent. Same applies for all other markdown concepts, like lists.

Environment

  • Operating system: Windows 11
  • Obsidian version: v0.13.5

I have paragraphs with HTML elements and CSS both working. Also v0.13.05
So not a global HTML issue.

But if you add some markdown formatting to paragraphs that have the HTML elements does the markdown get formatted or does it just render the markdown characters without doing anything with them.

I’ve also got paragraphs with both CSS and HTML and they’re working fine, it’s just the markdown rendering that seems to get lost in those paragraphs.

Yes the markdown is rendered correctly
Though, of course, markdown won’t render inside HTML.

Not rendering inside HTML is understandable yeah. Maybe you’ve got other ideas as to what the problem might be since I can’t explain it. I’ve turned off all custom CSS, Plugins, and themes.

As far as I can tell I’m also closing the HTML tag before adding any extra text after it.
Does the entire paragraph count as HTML as soon as there’s an HTML element within it?

Edit View

image

Rendered View

Sadly not, I’m no expert with HTML.
But, for instance, if you replace your div with code, it works fine. So it must be to do with your particular syntax.

Do you mean if turn it into a codeblock with the backtick characters? (`)

Yeah in that case it works. I was, however, hoping to insert an actual HTML element within the paragraph so that I can style it with custom CSS.

We don’t support intermingling markdown and html. You can have an html block within the markdown document but not markdown within the html (and you have ** ** _)

The file I am working in is a markdown file though (.md). That means the HTML block is within the markdown document no?

This bug/functionality doesn’t affect the whole file just the text after that specific HTML element which is why I find it weird that it’s not working. All other paragraphs containing markdown render just fine.

Edit: I think I get it now… The block containing the HTML element instantly becomes an HTML block right?

Again, we do not support parsing markdown within html blocks.

Yeah ok I understand what you mean now. Thank you!