What I’m trying to do
I’m looking for a filter to use in Obsidian’s Web Clipper extension that escapes tags while preserving markdown headings. Here’s an example.
Original:
text
# Heading 1
Some text with #tag and another #example_tag.
## Subheading
Result after replacement:
text
# Heading 1
Some text with \#tag and another \#example_tag.
## Subheading
Things I have tried
Here’s my current query based on this reddit thread:
{{content|replace:("\#":"\\\#")}}
Unfortunately, this seems to also escape the “#” symbol in markdown headings.
Thanks for your help!