Tag beginning with an underscore mess up the live preview render

A tag beginning with an underscore mess up the live preview render. If the underscore is inside or at the end of the tag, the render will be correct. The reading mode is not affected.

Source mode
Screenshot from 2022-08-05 20-25-28

Live Preview
Screenshot from 2022-08-05 20-25-37

Reading mode
Screenshot from 2022-08-05 20-25-51

Steps to reproduce

  • Activate live preview
  • Insert a tag beginning with an underscore and write some text after the tag (ex: #_todo this thing)

Expected result

The tag should render the underscore and the text after the tag need to be rendered normally.

Actual result

The text after the tag is rendered in italics and the underscore of the tag disappear.


  • Operating system: Tested on Windows and Linux in the sand-boxed vault
  • Debug info:
    Obsidian version: v0.15.9
    Installer version: v0.15.9
    Operating system: #1 SMP PREEMPT_DYNAMIC Fri Jul 22 14:03:36 UTC 2022 5.18.13-200.fc36.x86_64
    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: on