Annotations not importing properly from Zotero

What I’m trying to do

I am trying to create a workflow for thesis literature notes with Zotero and Obsidian. I have copied this template (see below between START OF TEMPLATE and END OF TEMPLATE)

The annotations and notes imported from Zotero start off looking normal, but then they begin looking like this:

Any help is appreciated. Thank you!

START OF TEMPLATE

Title: “{{title | escape}}”
Year: {{date | format(“YYYY”)}}
Authors: {{authors}}
Tags: {% if allTags %}{{allTags}}{% endif %}

Zotero PDF Link: {{pdfZoteroLink}}
Related:: {% for relation in relations | selectattr(“citekey”) %} [[{{relation.citekey}}]]{% if not loop.last %}, {% endif%} {% endfor %}

Persistent Notes

{% persist “notes” %}{% if isFirstImport %}
Write notes here!
{% endif %}
{% endpersist %}

In-text annotations

{% for annotation in annotations -%}
{%- if annotation.annotatedText -%}
{% if annotation.color %} “{{annotation.annotatedText | safe}}” {% else %} {{annotation.type | capitalize}} {% endif %}Page {{annotation.pageLabel}}
{%- endif %}
{% if annotation.comment %}
{{annotation.comment | safe}} Page {{annotation.pageLabel}}
{% endif %}
{%- if annotation.imageRelativePath %}
![[{{annotation.imageRelativePath}}]]
{%- endif %}
{% if annotation.allTags %}
{{annotation.allTags}}
{% endif %}
{% endfor -%}

END OF TEMPLATE

When I view the template I see this and am not sure if it is the problem?


Things I have tried

I searched for annotations but couldn’t find specific help.

Please share the template in a proper code block by putting three backticks before and after the template. As is, not all the formatting is visible, so it’s not possible to help.

Btw, where did you copy the template from?