Closed laszabine closed 8 months ago
Thank you for clarifying (and for your work on this!) Do you accept pull requests?
Sorry, I deleted my original comment before I saw your reply. I've just looked at it again and I think it can be considered a bug anyway. I have no experience with pull requests, but you can give it a try.
I just committed v0.11.3 that should exclude code blocks.
You find it in this branch.
The changes in the code are not yet tested. You may wish to update the test files and run test_zim2obsidian.py
. Then you can contribute the test data and further code changes, if needed.
As soon this is validated, I will publish the release.
Update: I just did it myself, merged the branch, and closed the issue. Good luck. If problems occur with your pages and code blocks, just re-open this issue.
Please do not use the issue tracker for off-topic conversations, also not in closed issues. Remember that this will send email notifications that are distracting.
Your concern is already clearly visible in the other issues and in the discussions, and I'm sure that anyone who wants to contribute will address it there.
As of version 0.11.6, the zim2obsidian.py script excludes paragraphs that are enclosed with three backticks from conversion, as well as inline text enclosed with a single backtick (see #22).
Actually, enclosing text with backticks is not the way to mark "verbatim" text as specified with Zim:
To render a whole block verbatim, the first and last line of the block should contain 3 quotes and no other characters.
For "Inline code", there is no specification. However, if you mark verbatim blocks as specified, the Markdown result as exported by Zim is just indented, which is currently not supported by zim2obsidian.py (see #20 ).
For the record: The changes made with version 0.11.6 are actually working, but they are not bug fixes in the true meaning of the word. You can use them, but you should be aware that by using backticks you are deviating from the Zim specification.
With version 0.13.0 the behavior as requested here is implemented, yet optional.
It can be selected with the --backticks
parameter.
See also: https://github.com/peter88213/zim2obsidian/discussions/15#discussioncomment-8918078
Application/script
Describe the bug The formatting in
zim2obsidian.py
should exclude any string that is in a code environment (surrounded by 3 backticks each, perhaps also in-line code environments?). In my case, I have code environments containing bibtex code which includes the character@
and it got changed to#
like a tag.To Reproduce
zim2obsidian.py
to the root location of the copied zim repositorypython zim2obsidian.py
Expected behavior Code environments should be excluded from the formatting.
Execution environment: