Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters are being escaped by a backslash #100

Closed
qadzek opened this issue Jun 6, 2023 · 2 comments
Closed

Special characters are being escaped by a backslash #100

qadzek opened this issue Jun 6, 2023 · 2 comments

Comments

@qadzek
Copy link

qadzek commented Jun 6, 2023

Thanks a lot for creating this very useful tool. You helped me liberate my notes 😃

I noticed however that a lot of special characters are being escaped by a backslash. I am using version 0.19.0.

E.g. for this short note in Evernote:

(parentheses) <angle> [square]
5 + 4 - 3
#hashtag bang! *star under_score

I receive this as output

\(parentheses\) \<angle\> \[square\]

5 \+ 4 \- 3

\#hashtag bang\! \*star under\_score

I wrote a little script to solve this problem, maybe it could help someone else:

#!/usr/bin/env bash

shopt -s globstar

for file in notes/**/*.md; do
  printf '%s\n' "$file"
  sed -i -e 's/\\-/-/g' \
    -e 's/\\(/(/g' \
    -e 's/\\)/)/g' \
    -e 's/\\_/_/g' \
    -e 's/\\+/+/g' \
    -e 's/\\#/#/g' \
    -e 's/\\!/!/g' \
    -e 's/\\\*/*/g' \
    -e 's/\\</</g' \
    -e 's/\\>/>/g' "$file"
done
@wormi4ok
Copy link
Owner

Hi @infinitewhileloop ! Thanks for sharing your solution!
These special characters are escaped indeed, to ensure that the resulting Markdown can be rendered correctly. I gave an example in another issue #55 (comment) .

It really depends on what result is more valuable - raw files in Markdown format or rendered Markdown text. I guess it is a good candidate to become a cli flag in the newer version. 👍🏻

@wormi4ok
Copy link
Owner

Here you go - the new release v0.21.0 does not escape special characters by default! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants