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

[Feature Request] split annotation into commment and quote

Open rjbergerud opened this issue 2 years ago • 1 comments

The highlight.annotation seems to be of the format {comment} - {quoted}. Is is this a limitation of the hypothesis API not splitting these two parts up in the returned annotation.text?

I was trying to regex around this in the templating, but it doesn't work when the quoted text includes a hyphen.

{% if highlight.annotation %}   - Annotation: 
{% set regExpQuote = r/(.+)(\-.+)$/g %}
{{ regExpQuote.exec(highlight.annotation)[0] }}
> {{ regExpQuote.exec(highlight.annotation)[1] }}{%- endif -%}

rjbergerud avatar May 28 '22 17:05 rjbergerud

So I thought I had this same problem, and in my case, it was actually the previous loop not moving to a new line before the next. So it was essentially doing

- {comment 1}
  - {annotation 1} - {comment 2}

I solved this by adding a line break right before the {%- endfor -%}.

ginsengtime avatar May 31 '22 13:05 ginsengtime