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.

Environment

  • Operating system: Tested on Windows and Linux in the sand-boxed vault
  • Debug info:
    SYSTEM 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

RECOMMENDATIONS:
none

1 Like

thanks

Steps to reproduce

Insert the following text into any document. View in Live Preview.

Text following #_thistag is rendered italic.

Text following #that_tag is rendered correctly.

Expected result

The underscore in #_thistag should not influence the rendering of following text.

Actual result

Text following the underscore in #_thistag is rendered italic.

Environment

Obsidian 0.15.9 on maOS and iOS
Tested with Default and Minimal theme.

You can escape it:

Text following #\_thistag is rendered italic.

Text following #_thistag is rendered italic.

You can escape it:

This fixes the layout, but breaks the hashtag functionality in Obsidian and other apps that access the same Markdown files.

There are other issues too, old ones.

Really weird things happen when typing more underscores, like text changing into bold and italic.

italic

And the underscores disappearing.
disappear