Escape character (backslash) should not show up in live preview

The backslash as an escape character shows up in live preview - I don’t think it should unless I am editing that line.

4 Likes

I understand your POV. Moving this to feature requests.

1 Like

Steps to reproduce

  • Activate live preview
  • type “\[ \]” or any other escaped character
  • move the cursor to a different line

Expected result

The backslashes should be removed, resulting in “[ ]”

Actual result

The backslashes are still visible => “\[ \]”

Environment

  • Operating system: Windows 10
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v0.13.14
    Installer version: v0.12.15
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Safe mode: on

RECOMMENDATIONS:
none

Additional information

2 Likes

Use case or problem

First I just wanted to say that I am very much loving Live Preview and Obsidian in general. It has helped my life in many many ways!

Anyways, this is mainly cosmetic, but oftentimes I will add backslashes before [, ], #, and other special markdown characters when I want to use their literal versions.

Proposed solution

Now that we are blessed with the Live Preview Mode, it would be cool for there to be a setting to enable or disable the visibility of these backslashes since we always have the option to go into Source Mode to see them, not to mention simply toggling this proposed setting off.

Current workaround (optional)

I will usually just toggle Preview Mode on temporarily. I do this mainly because sometimes the backslashes interfere visually with double checking that everything was done correctly.

6 Likes

I can certainly live with the conclusion that this is a feature request, and not a bug; but darn if it doesn’t feel like a bug! It’s seems kind of natural to expect that:

1\. (To prevent an indented, numbered list)
2\. (Again, to prevent an indented, numbered list)

would turn into

1.
2.

But again, definitely not worth losing sleep over. Just thought I’d mention it. Happy Holidays!

2 Likes

I was just coming here to report this. I agree it feels like a bug in LP.

1 Like

Are there any news on this? I’m relatively new to Obsidian but this is one of the main things I’m struggling with and leaves me with a broken life preview with proper markdown escaped characters or the other way around.

Agree with the above. Feels like a bug, but would be happy with this being added as a feature.

I’m writing an installation manual and this issue is quite bothersome as it interferes with some other characters. For example, the << character opens a string somehow, and highlights in green the section that follows:

When applying a backslash, it solves the green string highlight but now the person that’s applying this installation step wouldn’t be able to just copy paste the instruction.

Really hoping something is done about this

I’ve solved with this custom css snippet:

.markdown-source-view.is-live-preview .cm-line:not(.cm-active) .cm-formatting-escape.cm-hmd-escape-backslash {
    display: none;
}

will be implemented 0.14.11 (not with the custom css but that’s a good workaround)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.