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

add_resource_to_note assumes it is an image #24

Closed
init-random opened this issue Dec 10, 2023 · 2 comments · Fixed by #25
Closed

add_resource_to_note assumes it is an image #24

init-random opened this issue Dec 10, 2023 · 2 comments · Fixed by #25

Comments

@init-random
Copy link

init-random commented Dec 10, 2023

Please see here
https://github.com/marph91/joppy/blob/cc3d1f4d0c3b6fea08b8e8ed76c44eac2c512a45/joppy/api.py#L338C9-L338C9

If the resource is an image, this line is fine.
body_with_attachment = f"{note.body}\n![{resource.title}](:/{resource_id})"
Otherwise, we should not include the exclamation mark, i.e. it should be
body_with_attachment = f"{note.body}\n[{resource.title}](:/{resource_id})"
as in the case of adding a PDF resource.

The inclusion exclamation mark for non-images makes the resource unable to render.

@marph91
Copy link
Owner

marph91 commented Dec 11, 2023

Thanks for the report! I will try to release a fix soon.

@marph91
Copy link
Owner

marph91 commented Jan 17, 2024

Should be fixed in the latest release.

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

Successfully merging a pull request may close this issue.

2 participants