Attach file not working correctly on research notes
If I attach the file, it shows up in edit as code, but the file does not appear when published. The code shows publiclab/photos, and I think that may be the problem, as I'm not uploading a photo but a word doc.
Relevant URLs
https://publiclab.org/notes/Zengirl2/08-01-2017/how-cafos-factory-farms-are-plaguing-north-carolina-communities-of-color#c17140
PublicLab.org username
@zengirl2 (to help reproduce the issue)
Browser, version, and operating system
Chrome on Windows 8.1
For bug reports, fill out the above template; for feature requests, you can delete the template.
To learn how to write really great issues, which increases the chances they'll be resolved, see:
https://publiclab.org/wiki/developers#Contributing+for+non-coders
OK I have a fix! The legacy editor does it correctly, so someone just needs to compare that code to the Rich editor to repair it.
Thank you so much for documenting this. The Rich Editor uses the woofmark rich text library, and I see that (when i drag in a PDF) it generates the markdown:
[attachment-1]: /system/images/photos/000/000/001/original/Thumbnail_Agenda_Draft_June_29.pdf "Thumbnail_Agenda_Draft_June_29.pdf"
But there's no equivalent way to display that in the "Rich" mode, and upon switching it just disappears. We ought to display a "file" icon and the filename.
Looking through woofmark documentation.
OK, these lines generate the attachment markdown syntax:
https://github.com/bevacqua/woofmark/blob/master/src/markdown/linkOrImageOrAttachment.js#L122-L125
I am guessing that we could add a method to parse that into HTML and back, and it would preserve the upload properly. I'll try this.
I think I've got this! #1574... fingers X.
Still working on this one. Got stuck on publishing to the live site but should have an update on this in a day or two, thanks for your patience!
Now waiting on https://github.com/publiclab/PublicLab.Editor/issues/103 -- some issue intervened and blocked this for a bit... thanks for your patience!
Cool--if it doesn't work we can always use the older editor.
I believe this is fixed, if you can try it out!
On Sep 17, 2017 3:21 PM, "Leslie Birch" [email protected] wrote:
Cool--if it doesn't work we can always use the older editor.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1561#issuecomment-330076093, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ6jSiUe8FOdPKN4qX5655zCnyTV7ks5sjXEhgaJpZM4OrRVn .
OK, I tried it by creating a test note, which I can delete later. Issues:
-
You need floating text or paperclip icon so people know that you can add docs (right now it only talks about adding images). You could consider copying the text line that appears in the "comments" block. "Drag & drop to add an image or file, or choose one"
-
Right now if you drag a doc into the main block (like a PDF), it appears as text, but it is not obvious that it is a file unless you hover over it. I couldn't just click on it to open. I had to do a right click to open in a new tab.