Removing backticks from a selection

What I’m trying to do

Basically, I am using a markdown web clipper to get some articles off the web into my vault. But the code on that website is formatted in a very peculiar way, such that every string/word of the code is enclosed in separate opening and closing back-ticks.

For eg. instead of a simple int c = 10;, it is formatted is int c = 10 ;

This is very annoying, and manually removing all the backticks from a big code block is taking a lot of time.

Is there any way to just select a text-block, then remove all the backticks inside it, so that I can simply enclose them in a big code block of triple backticks like

int c= 10;
c++;
printf("%d",c);

Things I have tried

Searched the community plugins page, but could not find anything for this.

Here is one way to solve this:

  1. Write and test a javascript procedure that can process the file.
  2. Create a Templater template that calls the script and replaces the file contents with the result.

This plugin will help.

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