Home / GitHub Page

Support generating image link as <img...> format instead of markdown

Hi all,

I am using the Electron client of Joplin on Linux.

At the moment, when pasting an image to Joplin form the clipboard or when linking it from a file, the generated tag is a valid markdown similar to

![Some text](:/a8060c008321412a8eb9fb244a3a8e01)

However, as discussed in Resize images , there is no support for image UI resize with that format. A workaround, which I apply systematically (and manually) to all images I paste in my notes is to rewrite the link as an html link, which supports a width parameter:

<img src=":/a8060c008321412a8eb9fb244a3a8e01" width="500" />

Suggestion: how about having Joplin generate image link directly as an html <img ... instead of pure markdown, since that format has the advantage of supporting resize ? Or maybe making that behaviour possible through configuration? Maybe the width could default to some value specified in config, or would always be initialized to the the physical image size or something. We would also leave the height blank, s.t. the image ratio would be kept.

I am a developer, although somewhat ignorant of javascript. If you like the suggestion I’m happy to contribute to the implementation. If I read the 3 files below correctly if would be about letting markdownTag() in Resource.js generate <img html links for images.

What do you think ?



I think this was discussed before, but I can’t recall what the conclusion was.

If it were possible by using a markdown plugin, I believe Laurent would accept a PR. @laurent do you remember the previous disussion?

Hi,

I could find previous discussions about images, though, not specifically about generating <img elements directly.

I don’t mind looking into trying to do this with a markdown plugin. Please let me know if you think it’s a good idea and I’ll start coding :slight_smile: