How to strip unnecessary escape characters?

Hi all,

I have a quite special need I guess… looking for ideas how to solve the issue.

There are a LOT of superfluous escape characters in my content imported into Obsidian.
(reason see bottom of this post, in case it’s interesting. Footnote #1.).

How can I get rid of them?
(Why do I want this? See Footnote #2).

My ideas so far:

  • Looking for a plugin that does this. Didn’t find any.

  • Copying the reading view and pasting into source view. Kind of works, but it’s tedious, as copying entire notes in reading view is not possible. Only manually selected parts, and my note files are partially HUGE. Selecting while scrolling makes Obsidian unresponsive…

  • Using some script that removes the redundant characters. I didn’t find one especially made for Obsidian, and I don’t trust ChatGPT’s output. Don’T want to ruin my notes. And it’s so much I cannot test it all after conversion. Need a solution that’s reliable.

Any ideas or even solutions?

Thank you so much!
Daniel


Footnote #1: Why do I have so many escape characters?

I have exported a lot of content from another note taking application to Markdown for use in Obsidian. The export feature of that other application has been tweaked a lot to meet Obsidian’s MD dialect well, but not 100%.
The application I come from is programmed to escape every occurrence of the characters in question. Even those which only need to be escaped at beginning of a line. The author refused to implement a more intelligent escaping due to limited time. No way to change that.


Footnote #2: Why do I want to remove the redundant ones?

Because when copying/pasting content from source view the scape characters are copied along.
Also, when placing the cursor into such content and Obsidian shows the source of the line, these many escape characters make the content almost unreadable.

Whatever it is, it would be better to tweak it more…?

I thought you’d give example lines here for us to see what unescaping needs done.

1 Like

Couldn’t any of the “Find and replace” community plugins help you a little ? :thinking:

They don’t necessarily offer a vault wide find & replace feature, but I think most can at least do a document wide “find and replace”.