obsidian-hypothesis-plugin icon indicating copy to clipboard operation
obsidian-hypothesis-plugin copied to clipboard

only sync with the first highlight in a webpage

Open Ryangoabroad opened this issue 3 years ago • 3 comments
trafficstars

Hi, I have multi-highlights & annotates in a webpage(https://sspai.com/post/72697). but this plugin only synchronize the 1st highlight I made, and ignore others in the same webpage.

I check in the settings of this plugin,it shows all multi-highlights & annotations have been synchronized, but in obsidian there is only 1.

Ryangoabroad avatar Jul 10 '22 01:07 Ryangoabroad

The default template has a bug, please remove the checking around highlights and notes.

Make it to this:

## Page Notes
{% for highlight in page_notes -%}
{{highlight.annotation}}
{%- if highlight.tags | length %}
Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}
{% endif %}
{% endfor %}

## Highlights

{% for highlight in highlights -%}
- {{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}})
{%- if 'Private' != highlight.group %} 
- Group: #{{highlight.group | replace(" ", "-")}}{% endif %}
{% if highlight.tags | length %}    - Tags: {% for tag in highlight.tags %} #{{tag | replace(" ", "-")+" "}}{% endfor %}
{% endif -%}
{% if highlight.annotation %}    - Annotation:
    {{highlight.annotation}}
{% endif %}
{% endfor %}

chenyukang avatar Jul 14 '22 07:07 chenyukang

@chenyukang This solution creates duplicates of the already existing notes and highlights. Is there a way to avoid this?

lanluo9 avatar Jul 15 '22 13:07 lanluo9

@chenyukang This solution creates duplicates of the already existing notes and highlights. Is there a way to avoid this?

Actually I didn't meet this duplicated error, mostly because I open Obsidian almost all time and this plugin has an automatically sync option, when this option working it will fetch from remote in a increment way, so it won't create duplicated one。

But it's an issue that possibly happen when fetch from remote server not in incremental way。

chenyukang avatar Jul 27 '22 15:07 chenyukang