weichenw / obsidian-hypothesis-plugin

An Obsidian.md plugin that syncs highlights from Hypothesis.
MIT License
235 stars 20 forks source link

Fix multiple annotation template rendering #53

Closed radekkozak closed 2 years ago

radekkozak commented 2 years ago

This fixes nunjucks template rendering of multiple annotations.

Default template would cause omitting original highlights that specific annotations were describing and just rolling them under the first user highlight in the text.

Signed-off-by: Radek Kozak <radoslaw.kozak@gmail.com

radekkozak commented 2 years ago

Hi, first of all - thank you for creating the plugin!! Just started to play with it as i think it would be excellent for my Obsidian workflow right now. Good stuff

Second: i spotted weird thing when annotating an article. Got few of annotations but with default template they would roll under only one & the same highlight - even though they belonged to different ones. This could be very misleading for users of the plugin as one could think the plugin itself is not parsing all of data provided by Hypothes.is API.

I checked - underlying data was ok right until the moment it was put through Nunjuck template provided.

See attached screenshots as what it would all look like when rendered before & after

With this PR:

bugged fixed

Cheers

weichenw commented 2 years ago

Thanks alot mate

radekkozak commented 2 years ago

You got it. Thanks again for the nice plugin. Cheers