Special characters are being escaped by a backslash
qadzek opened this issue Β· comments
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
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. ππ»
Here you go - the new release v0.21.0 does not escape special characters by default! π