[5.0 Beta] Links are being deleted in notes
I just upgraded to Zotero 5.0. I noticed that the zotfile 'open-pdf' links no longer work. However, as I was investigating the cause and a possible solution, I noticed that my notes containing these zotfile links were being altered; the links were deleted. The visible text would remain in the note, but the blue & underlined styling was removed. I looked at the underlying code and found the href attribute was deleted.
For example, the code went from:
a> href="zotero://select/ite...">zotero://sele ... /a>
to
a>zotero://select/ite.../a>
(html brackets broken to prevent link creation in above examples; ellipses added to shorten)
I enabled the debug console and captured as the links were destroyed. I included two links in the note: one to http://zotero.org and one using zotero://select ...
Here is a link to the full the debugging output:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845
It seems that the links are being stripped of their href element sometime in here:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845#file-zotero_debug_vanishinglinks-txt-L211-L287
Is this intentional behavior that won't be changing? Or is it a bug?
For example, the code went from:
a> href="zotero://select/ite...">zotero://sele ... /a>
to
a>zotero://select/ite.../a>
(html brackets broken to prevent link creation in above examples; ellipses added to shorten)
I enabled the debug console and captured as the links were destroyed. I included two links in the note: one to http://zotero.org and one using zotero://select ...
Here is a link to the full the debugging output:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845
It seems that the links are being stripped of their href element sometime in here:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845#file-zotero_debug_vanishinglinks-txt-L211-L287
Is this intentional behavior that won't be changing? Or is it a bug?
I know that doesn't narrow it down a lot; but it eliminates the tinymce plugin as the culprit.
I also want be able to add these "zotero://open-pdf/" links manually (via the TinyMce link menu and by pasting HTML clipboard) : both are possible, but the links also get removed on sync.
I have noticed that if I create a zotero://open-pdf/0_xxx link manually via the TinyMce menu and then click on the link before the sync, then the sync doesn’t remove the link until the next change in the note : once I modified the note by adding another link or simply taping a letter, then the link is removed on the next sync.
https://github.com/zotero/zotero/issues/1163
As @dstillman said, it is a server side issue. I think it involves HTMLPurifier
https://github.com/zotero/dataserver/issues/35
While not ideal, I've stopped syncing my library to prevent this from happening.