elias-sundqvist / obsidian-annotator

A plugin for reading and annotating PDFs and EPUBs in obsidian.
GNU Affero General Public License v3.0
1.42k stars 63 forks source link

annotations disappeared? #194

Open erankatz2020 opened 1 year ago

erankatz2020 commented 1 year ago

Hello, so this weird thing happened: I was annotating a PDF in my vault. Everything is working fine, I finish annotating the PDF and then I switched to MD mode to process those notes and highlights. Then I close Obsidian, and when I came back to that note, I still see my annotations in MD (luckily!) but the PDF version is not there. Then I noticed that the YAML portion of the note is not there. I really don't understand how. I put the YAML back with the "annotation-target:" and all and the PDF comes back but with no highlights or page notes.

I'm not even sure it's a bug with this plugin or something weird that went with my Obsidian, just wanted to let you know.

Sheemie commented 1 year ago

Hi. Same issue has happened to me too. My annotations disappeared on my Mac two days ago and not it happened on my iPad too. They are in MD but PDF version shows "There are no annotations in this group" which is the "only me" group, and I have never changed any setting or sharing notes to other people.

Thank you for initiating this @erankatz2020

vultix commented 1 year ago

I'm seeing the same problem with both epubs and pdfs

josephyooo commented 1 year ago

same. i open a note with my annotations and link to the pdf, open annotations, make a highlight, see it show up in the MD version, then open/close the annotation page, and the highlight is gone although it's in the file and I made no changes.

josephyooo commented 1 year ago

figured it out, at least for me. if there's even a single misformatted annotation, no annotations are recognized. that's why even if you open the note in annotation mode and add a perfectly good annotation (i.e. within hypothes.is & within your MD file), reloading it won't show any annotations.

for me, I caused an issue when I deleted the *'s wrapping the display text (prepended by %%PREFIX%% and appended by %%POSTFIX%%...). i had to go through and add them all back and my annotations showed up again.

taylor-knapp commented 1 year ago

One additional note to @josephyooo's finding - I encountered this using highlights with no pre/postfix. The requirement is that a * must proceed %%HIGHLIGHT%% and follow the final text. It does allow you to change which sections are enclosed in *s if you wanted to change italics in the quote (as long as the beginning and end are).

i.e.

*%%HIGHLIGHT%%Only italicize this line.* But not this one.

Here's a block quote inside the quote that will not be italicized.

*But we need to italicize the final character, at the very least.*