cherrytree
cherrytree copied to clipboard
RTL export broken
Version, Operative system v0.99.47, Fedora 35. Bug has been present since I started using Cherrytree on Debian 8, around 2015.
Describe the bug Documents in RTL script are exported as LTR.
To Reproduce Create a new node with any RTL script. Note that Cherrytree renders it perfectly fine. Export to PDF or HTML. Notice that it's now aligned as LTR - punctuation and characters are fine.
Screenshots
Potential Solution
After exporting to HTML, adding dir=rtl
to the exported HTML's <head>
makes the whole file RTL, and breaks LTR paragraphs. A solution could be to add the dir
attribute to each paragraph on export, according to the detected alignment in Cherrytree itself.
can you attach to the issue a sample cherrytree document with mixed RTL and LTR text so I'll try and fix at least the html export
Of course. Please let me know if there's anything else I can do to help!
FIY, @giuspen - as of commit 446f5cc, there are very marked improvements! HTML export does indeed seem complete, while PDF export is almost there - at least for me, lines that start in LTR and also contain RTL (or vice-versa) have the wrong alignment for the second type.
Major props to you for being so responsive and fixing this issue!
Yes I'm getting there with the pdf too, even though much more difficult than the html. Good that you keep an eye, so when I'll declare it complete some testing will help. I think it will take few more commits.