Open titusio opened 9 months ago
this! How to exclude ALL syntax that will mess up obsidian sync??
For those trying to solve this, go to the customize section by clicking the button in the extension settings then in the yaml frontmatter change {{author}}
to {{author|replace("@","")}}
Hello! Contributor to the plugin here. Sanitization is an issue with the export functionality itself (readwise's backend), not the plugin. I've reported it to them in a formal bug report - I'd encourage you to also do the same. You can submit a formal bug report in Reader.
That said, here's my own exports configuration for filename and front matter santization. You'll wanna use these snippets on the export preferences page.
File name config
{{ title|replace('@', '')|replace('#', 'no.')|replace('^', '')|replace('[', '(')|replace(']', ')')|replace('^', '')|replace(': ', ' - ')|replace(' | ', ' - ') }}
^ note that there's a few opinionated replacements in there. I explain them here.
YAML Front matter (note that @
is allowed in frontmatter if you quote it)
aliases:
- "{{title}}"
{% if author %}author: "{{author}}"{% endif %}
{% if document_tags %}related to: {% for tag in document_tags %}
- "[[{{tag}}]]"{% endfor %}{% endif %}
tags:
- artifact/readwise{% if category %}/{{category}}{{ "📚" if category == "books"}}{{"📰" if category == "articles"}}{{"🐦" if category == "tweets"}}{{"🎙" if category == "podcasts"}}{% endif %}
@0xDezzy worth noting that you can just use quotes around it like "{{ author }}"
in frontmatter instead of replacing it.
My export looks something like this:![image](https://github.com/readwiseio/obsidian-readwise/assets/80385479/df27f578-b00c-469b-9be6-41992edaaae4)
The import fails because the '@' character is not allowed for naming files. This results in this error message:
It would be really helpful if the '@' character would just be removed.