Running Zim (perl) 0.28 from .deb on ubuntu 8.04; Gtk2 version is 1.183.
When you cut and paste a block of text containing a relative link (e.g. [[.Subpage]] ) to another page on a different "hierarchy level" (i.e. if original text was on :Home:Level1:Level2:Page, then was moved to :Home:Level1:Page), those relative links aren't modified to point to the same place they originally did. Thus, in the above example, the link originally would have pointed to :Home:Level1:Level2:Page:Subpage, but afterward points to :Home:Level1:Page:Subpage (a nonexistent page; the original linked page is now "stranded" and inaccessible unless the relative link is manually changed).
This is a pretty straightforward problem--the cut-and-paste simply moves the relative link as-is, without any "awareness" of what the link's actual destination was prior to the move. Note this problem does not exist for pages that are MOVED using Zim's rename page dialog (since it has an "update links" feature).
Hi, I believe I may have identified the general area for the fix, however I had a question about where I should implement this, if anyone wants to provide input.
I can either do this inside pageview, however this means I have to implement the sharing mechanism (as well as other machinery) inside pageview, this might not be architecturally sound or wise, or I can create an external object (link-handling.py) which just reads all copy/paste calls and sanitizes them appropriately.
The second approach sounds cleaner but looking at the code it is unclear which route to take - a lot of link handling already seems to occur in various parts of the code, so it might be a good idea to decouple this functionality in future, but at the same time it might cause confusion and also create un-necessary work in re-writing/moving large bits of code functionality.