mgmeyers / obsidian-zotero-integration

Insert and import citations, bibliographies, notes, and PDF annotations from Zotero into Obsidian.
GNU General Public License v3.0
996 stars 55 forks source link

Zot-purple annotations are rendered as zot-blue #293

Open Sriramgireesh opened 11 months ago

Sriramgireesh commented 11 months ago

I am not sure if this problem relates to this plugin. I use the following template for extracting zotero annotations.

## Annotations ✏️
{% for annotation in annotations -%}
{%- if annotation.annotatedText -%}
{% if 'Gray' in annotation.colorCategory %}

<br>

### {{annotation.annotatedText | escape }}
{% elif 'Magenta' in annotation.colorCategory %}

#### {{annotation.annotatedText | escape }}
{% else %}

{% if annotation.comment %} 
- <mark style="background: #b30000;"><font color="#ffff00">🗨️ {{annotation.comment}}</font></mark>
{% if annotation.annotatedText %}
    - <mark class="customZot-{% if annotation.color %}{{annotation.colorCategory}} {% endif %}">{{annotation.annotatedText | nl2br}}</mark> [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}{% endif %} {% endif %}

{%- elif annotation.annotatedText %}
- <mark class="customZot-{% if annotation.color %}{{annotation.colorCategory}} {% endif %}">{{annotation.annotatedText | nl2br}}</mark> [(p. {{annotation.pageLabel}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {% if annotation.hashTags %}{{annotation.hashTags}}{% endif %}
{% endif %}
{%- endif %} 

{% endif %}

{%- if annotation.imageRelativePath -%}

-  {% if annotation.comment %} <mark style="background: #b30000;"><font color="#ffff00">🗨️ {{annotation.comment}}</font></mark> {% endif %} ![[{{annotation.imageRelativePath}}]]   **[pg. {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})**
 {%- endif %}

{% endfor -%}

This template essentially extracts highlights from my documents while retaining the colour of the annotation. While the rest of the colours are rendered correctly without any problem, purple annotations are rendred as blue.

To illustrate, the following annotation is annotated in purple. image

However, the annotation in Obsidian is rendered as blue. image image

FeralFlora commented 11 months ago

This is a known issue, so this is a duplicate. See: https://github.com/mgmeyers/obsidian-zotero-integration/issues/168 and in particular this comment by @mgmeyers: https://github.com/mgmeyers/obsidian-zotero-integration/issues/168#issuecomment-1616913337

There are also some other workarounds in that thread that people have suggested.

Remember to search both open and closed issues before opening new ones.