zotero / translators

Zotero Translators
http://www.zotero.org/support/dev/translators
1.28k stars 756 forks source link

Zotero RDF: Rewrite annotation links in notes on export/import #3074

Open dstillman opened 1 year ago

dstillman commented 1 year ago

https://forums.zotero.org/discussion/106095/show-on-page-function-doesnt-work-after-transfering-my-library-to-another-laptop

I think we'd have to rewrite these on export to point to an identifier and rewrite again to the new item keys on import.

CC @mrtcode for any input

mrtcode commented 1 year ago

We can probably just replace item keys with regular expressions, without parsing note HTML. There is a chance that you pasted item key manually into note text, and it will also be replaced, but I don't think we should care about this case.

dstillman commented 1 year ago

Oh, but there's no guarantee that the referenced attachment is actually in the export. So really we should only replace keys that match attachments that are actually being exported and leave the rest unchanged (so if you just exported a note and reimported it into the same library, the links would still work, even if that would rarely be the case).