Live Preview not rendering HTML character entities

Steps to reproduce

  1. Create a new note and go into Editing, Source Mode.
  2. Add the following two lines of Markdown to the note:
This is <span style="color: red;"><em>a test</em></span> that uses inline HTML.

This is a test that uses HTML&nbsp;character entities&mdash;which is also inline HTML.
  1. Change to Reading view to see what it looks like fully rendered.
  2. Change back to Editing view and switch to Live Preview
  3. See the problem – the first line is fully rendered in Live Preview, with the inline HTML applied, but the second line is not rendered … the HTML character entities &nbsp; and &mdash; are rendered as plain text. I expected to see the second line fully rendered as well.

Live Preview should be rendering HTML character entities. Given that Live Preview does render inline HTML tags, it is unclear why Live Preview would not render HTML character entities (which can also be considered to be inline HTML).

I think that this discrepancy is either an oversight or a bug; it doesn’t feel like an intentional design decision. Hence, this bug report.

Did you follow the troubleshooting guide? Y

I reproduced this problem in the Obsidian Sandbox.

Expected result

In Live Preview mode I expected to see the HTML character entities rendered to the correspond character glyph.

Actual result

I saw the plain text HTML character entity, identitical to what I see in Source mode. The character entity was not rendered.

Environment

SYSTEM INFO:
Obsidian version: v1.5.3
Installer version: v1.4.13
Operating system: Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELEASE_X86_64 23.3.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

I don’t think screenshots are needed. Let me know if they are needed and I’ll provide them

What a coincidence, I was facing the exact same issue today. Here are the things I tried:

  1. Advanced Editor Plugin: Installed the “Advanced Markdown Editor” plugin, hoping it would better handle HTML entities in Live Preview.
  2. Update Obsidian: Checked for updates to ensure my Obsidian was current, in case there was a fix.
  3. Source Mode Editing: Switched to Source Mode for the specific parts with HTML entities, then back to Live Preview to see the outcome.

However, none of that helped, so I’m reaching out here for any additional insights or solutions. If anyone has tackled this successfully, I’d greatly appreciate your advice!