jabref
jabref copied to clipboard
Allow file attachment into the comments editor (Markdown)
How to reproduce
- Create a library with the file directory is
.
- Firefox: Visit https://www.sequoiacap.com/article/ai-powered-developer-tools/
- Firefox: Import into JabRef
- Go to the tab "Comments"
- From Firefox: drag'n'drop the image onto the comment field
Expectation:
-

appears in the editor -
dev-ai-wide-10.png
exists next to the.bib
file (which is the file directory configured for the bib file)
Actual behavior
File is attached
Additional Info
Note: Deep link to the image: https://www.sequoiacap.com/wp-content/uploads/sites/6/2023/03/dev-ai-wide-10.png?resize=1440,1400
TODOs
- [ ] 1. Use JabRef's download functionality
- [ ] 2. Add link into comment field (next to cursor)
- [ ] 3. Change "Find unlinked files" to ignore files linked in the comment fields
Background:
- Feature in VS.Code: https://code.visualstudio.com/updates/v1_79#_editor
Hello, I'm an undergraduate programming major that's eager to make my first GitHub contribution. Would I be able to claim this issue? Thanks!
I'm thoroughly occupied with the other issue I claimed (#10558), so I "unassigned" myself on this one. I'm not going to work on it at all, so it is completely free for someone else to claim.
Hi, I'm looking for an issue for my project. Would you mind assigning this issue to me? I will try to fix it. Thanks!
Hello there, would you be able to assign this project to me? I am supposed to work on an beginner - friendly issue for my Software Engineering Class.
As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.
Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.
@weronikaulbricht Since there has not been any activity, I assume you have given up on this project, therefore will unassign you to make this issue available to other contributors. If you are still on it, just leave a message.
@ThiloteE If you would like, you can assign this issue to me!
I already assigned you to another good first issue today. Are you sure? Don't overload yourself.
Hey, I'm looking for a good first issue and want to work at this one. I already have installed the jabref-Program working on intellij. Currently I try to reproduce the issue and need more information about the guideline.
At first what is important about the file directory, named: "."?
How to reproduce
- Create a library with the file directory is
.
- Firefox: Visit https://www.sequoiacap.com/article/ai-powered-developer-tools/
- Firefox: Import into JabRef ...
@ADm1n766 create a new library in JabRef , then right click on the library properties -> General file directory set to "." this means it will take the relative path of the library, the location of the .bib file
Probably I've reproduced the Issue completely: At first I created a new library, then put some information in required fields from the website and copied the image "03/dev-ai-wide-10.png?w=1024" and if I have a connection to a network the image is displayed.
But if I want to put the image per drag and drop from the website without saving in a file directory I get the exception:
Uncaught exception occurred in Thread[#53, JavaFX Application Thread, 5, main] ReferenceError: Can´t find variable: Mark
and much more detailed information. Thats the issue right?
@ADm1n766 Would be great if you could post the whole stackrace and if you have some local stuff already then go create a PR. Without seeing any code or the complete stacktrace it's hard to identify the root cause
Of course, with pleasure! Here is a screenshot from my exception:
ReferenceError: Can´t find the variable: Mark The whole exception stacktrace was: netscape.javascript.JSException: ReferenceError: Can't find variable: Mark at [email protected]/com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:160) at [email protected]/com.sun.webkit.WebPage.twkExecuteScript(Native Method) at [email protected]/com.sun.webkit.WebPage.executeScript(WebPage.java:1576) at [email protected]/javafx.scene.web.WebEngine.executeScript(WebEngine.java:985) at [email protected]/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211) at [email protected]/org.jabref.gui.preview.PreviewViewer.lambda$new$2(PreviewViewer.java:176) at [email protected]/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:192) at [email protected]/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:91) at [email protected]/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80) at [email protected]/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102) at [email protected]/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113) at [email protected]/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147) at [email protected]/javafx.scene.web.WebEngine$LoadWorker.updateState(WebEngine.java:1264) at [email protected]/javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1379) at [email protected]/javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1244) at [email protected]/com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2577) at [email protected]/com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2421) at [email protected]/com.sun.webkit.network.URLLoaderBase.twkDidFinishLoading(Native Method) at [email protected]/com.sun.webkit.network.HTTP2Loader.notifyDidFinishLoading(HTTP2Loader.java:566) at [email protected]/com.sun.webkit.network.HTTP2Loader.lambda$callBackIfNotCanceled$10(HTTP2Loader.java:429) at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) at [email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) at java.base/java.lang.Thread.run(Thread.java:1583)
Ah interesting, that is coming from the javascript that is used for the search highlighting:
at [email protected]/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211)
The issue at hand is about the Markdown editor (!) , not the preview.
As picture:
Please try to focus on that and not to find other issues.
The class to modify should be https://github.com/JabRef/jabref/blob/f570a2d9157f9667bc84a1c2e4e6a4f15d999ca5/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java#L15.
Note for developers: The preview is discussed in an internal issue https://github.com/JabRef/jabref-issue-melting-pot/issues/452.