Use standard MD links for images

Hello,

I’d like to suggest the option to use standard markdown links for pasted images, this would enable interoperabilty.

I write notes with images and I’d like to export them as a PDF using another markdown visualizer. As of today, if there are images, I cannot do it

thanks

18 Likes

Hi, Obsidian supports standard markdown format for images.
Are you sure you simply don’t have a path problem with your images?

hi,
if I have an image in the clipboard and I paste it, the link created is not a standard markdown link, so I have to edit the link myself, as well as renaming the image filename to remove spaces

Ok, now I understand. We have decided to go with a more compact notation for links and images to improve interpretability and and ease of use. It’s the same syntax used by wikipedia and other software.

A plugin is in the works to convert a note to “standard markdown”, i.e. convert [[ ]] to .

5 Likes

Hello! Standard markdown format for images is like ![image](link.jpg) right? But when I use this format in Obsidian, I failed to see this image in preview, it just display an icon of broken image but not the image I embeded, I don’t know why… Hoping for your reply~

1 Like

I think it would be better to add the option/plugin in which it will let user decide which kind of syntax to use instead of each time converting the document. As an example I like to use different editors (obisidan and typora for desktop + markor for android) on the same synced notes. If you could just export it to convert it, it would make a very clunky workflow for the users.

6 Likes

This code works for me, and in other apps like Typora. Don’t know how standard it is.

[![](Images/test.jpg)](Images/test.jpg)

1 Like

Thank you for your reply, but I tried your syntax on my computer and it still don’t work :frowning:

Did you put the image files in an Images subfolder?

1 Like

I put pictures in an “Attachment” file folder, which is in the same file folder with my markdown file. I tried to embed images from many kinds of locations of file folders by a standard syntax, but all failed…
Still thanks for your reply~

Try these. Adjust as you need to.

[![](your-file-name.jpg)](your-file-name.jpg)

[![](Attachment/your-file-name.jpg)](Attachment/your-file-name.jpg)

1 Like

The problems could be with your file names depending on the app you’re trying to view them in. For example, in 1Writer you have to URL encode the file names for the image to be viewed properly. I had the same problem and was able to get it to work.

Hi, I’m building a MD file processor that seeks to fix these issues. I’m trying that my markdown files work in Obsidian, Typora and 1Writer.

So far images and links between notes are working. Will test some more and release it somewhere in this forum, hope it helps.

4 Likes

Thanks! The first one works for me in Obsidian, but cannot read by Typora, so… I still cannot export my file to word or pdf :joy: But really thank you very much for your enthusiasm! Maybe I should wait for the developer to find ways to transfer the “Obsidian syntax” into standard syntax (:з」∠)

1 Like

Any progress on that? What would do the job is a simple editor setting that will allow a user to paste images with markdown syntax and proper path

I don’t want to convert all [[]] to standard markdown, I want to change it only for images

2 Likes

I’ve made progress but not ready for prime time. Actually started doing this in Perl, ditched the effort and started again in Python. But I had to learn Python first :wink:

You can take a peek in GitHub: https://github.com/pdazero/mdlinkprocessor

All code is unit tested. Maybe you can look at the test classes and reflect on the use cases.

My idea is to build a file processor that keeps my MD files compatible between Obsidian, Typora and 1writer no matter where I edit them. It will:

  • Fix Internal MD links and embedded images for maximum compatibility
  • Move attachments to “attachments/note name/“ path in the vault (Typora uses this approach and is a lot tidier)
3 Likes

Could you elaborate on this a little? I am finding it difficult to get images working in 1Writer. I am using the standard markdown syntax, still it is a little hit and miss.

TIA!

I had to put mdlinkprocessor work on hold due to day job pressure but in the meantime I’ll elaborate:

  • Obsidian uses wiki syntax for images [[some image.jpg]]
  • Standard markdown uses the same format for images and hyperlinks, so the target must bye url encoded: [some image](some%20image.jpg)
  • Also in standard markdown if you want to “embed” the link (in other words, show the image in preview) you have to put an exclamation mark “!” like this: ![some image](some%20image.jpg)
  • Add to this that you may want to put all images in a Images or Attachments folder, or in a specific “Note XYZ Attachments” folder. So, you would need to url encode the path as well in the link.

Furthermore, I write in Spanish, and tildes are a pain on their own, as the character encoding can be different depending of several factors I don’t totally understand yet. This means that the encoded tilde character like “ú” does not get properly recognized if I write the note in Windows and then read on Mac; or even between other markdown editors on the same platform.

For maximum compatibility I would suggest not using tildes or other special characters in links or image file names.

Well that’s about all I’ve found out to date. I work primarily in a Mac and have all sorts of Keyboard Maestro and python scripts to help me out with this madness :joy: but in Windows I’m stuck.

Hopefully all this ranting sheds some light.

The solution that could solve all these issues for me is to have an option each for “Image” or “Attachments” and for “Links”.

  • When pasting/insetring images -> use standard markdown syntax
  • While all other wikilinks are still created with wikilinks [[ ]].

It is much needed!!!

3 Likes

Yes, absolutely agree. It’s important to avoid straying from standards when it isn’t absolutely necessary. With Obsidian, none of my images work in other Markdown apps. While an exporter might help this, it would mean I would need to keep two sets of files and can’t work on the same file in different apps (e.g. Obsidian for organisation, and Zettlr for academic citations). Wiki links for regular links makes sense because it doesn’t break text flow with extraneous brackets when unnecessary, but in the case of images this isn’t so important since the entire block is just a placeholder.

4 Likes