Repository navigation
feat(ui): enable the attachment button in the editor - #19
Merged
Merged
Conversation
Uploading a file stores it with the Notes API v1.4 endpoint and inserts a reference at the textarea cursor: an image for image files, a link otherwise. The reference keeps the Nextcloud-compatible form .attachments.<noteId>/<name> and is percent-encoded so it parses as a markdown destination. The preview resolves those references by fetching the bytes with the authenticated client and using cached blob URLs, so images render without turning the endpoint public. Blob URLs are applied after sanitizing, and revoked when the note changes or the component unmounts. Failures are shown in the editor, including the 32 MiB size cap. Closes #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18.
Uploading a file stores it with the Notes API v1.4 endpoint and inserts a reference at the textarea cursor: an image for image files, a link otherwise. The reference keeps the Nextcloud-compatible form
.attachments.<noteId>/<name>and is percent-encoded so it parses as a markdown destination.The preview resolves those references by fetching the bytes with the authenticated client and using cached blob URLs, so images render without making the endpoint public. Blob URLs are applied after sanitizing, and revoked when the note changes or the component unmounts. The host CSP already allows
img-src ... blob:.Failures show in the editor, including the 32 MiB cap.
Verification:
npm run buildandvue-tsc --noEmitpass