I’ve been adapting some of the really nice templates in another post in the forum. I’m noticing an issue that happens when a highlighted portion of text has a line break in it. Generally, this is when the highlighted text starts a new paragraph. When an import of the annotation from Zotero goes into Obsidian, the callout behavior breaks: the portion of imported text after the line break is not contained within the callout.
So, what needs to happen, it seems, is for the blank line to be replaced with a > mark so that the paragraph break remains within the callout. But I can’t figure out how to code that.
Here is my template:
---
{% if title %}Title: "{{title}}"{% endif %}
Author: {{creators[0].lastName}}, {{creators[0].firstName}}
{% if publicationTitle %}Publication: "{{publicationTitle}}"{% endif %}
{% if date %}Date: {{date | format("YYYY-MM-DD")}}{% endif %}
citekey: {{citekey}}
subject: {{abstractNote}}
tags: {{allTags}}
MOC:
---
## {{title}}
| Info | Data |
| -------- | ----------------- |
| Citation | {{bibliography}} |
| Zotero | {{pdfZoteroLink}} |
| Tags | {{allTags}} |
# Annotations
{% for annotation in annotations -%}
>[!Note|{{annotation.color}}]+
>{%- if annotation.annotatedText -%}« {{annotation.annotatedText}} » ([{{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})){% endif %}{% if annotation.imageRelativePath %}![[{{annotation.imageRelativePath}}]]{% endif %}{% if annotation.comment %}
>
> ---
>- {{annotation.comment}}{%- endif %}
{% endfor %}