Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] split annotation into commment and quote #52

Open
rjbergerud opened this issue May 28, 2022 · 1 comment
Open

[Feature Request] split annotation into commment and quote #52

rjbergerud opened this issue May 28, 2022 · 1 comment

Comments

@rjbergerud
Copy link

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 -%}
@ginsengtime
Copy link

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 -%}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants