Use standard MD links for images

+1 please

1 Like

I would also like to have separate options for internal vs. external links. For internal links, Wikilinks are less verbose and nicer. For external links, Markdown links are not only more interoperable with other apps but they’re also easier to read (the text should come first, not the less important URL).

Great suggestion for interoperability. Hope to see this added soon.

Use case or problem

Obsidian ![[image-embed.png]] syntax is not consistent with markdown standards, and I like interoperability wherever I can get it. This makes it difficult to use other markdown hypertext notebook tools like LogSeq on the same directory. In the editor settings, I can replace wikilinks with markdown syntax for linking to files. However, I want to keep wikilinking to pages, and change image embeds to a more traditional ![image-embed.png](../assets/image-embed.png). I can only change them both at once.

Proposed solution

Create separate settings for toggling wikilinks/markdown links for pages and images.

1 Like

Please

Let’s not forget that it would be useful to have separate options for internal markdown links and external web links. internal markdown links should be using [[wikilinks]] syntax while external links should be using [markdown](http://syntax)

Bump. I’m in the exact same boat as OP; I need Wikilinks for md but markdown for imgs for my site to work.

1 Like

I am bumping because I just tried to import my vault to dendron and all my images broke. I was under the impression that my data was portable

This is pretty darn important to me. I’m writing my thesis in Obsidian, using pandoc to convert the Markdown to PDF (even managing to skip LaTeX, which is great!) - but all my images break and I’m having to manually fix the links…

In fact, I think it’d be great to have new settings in Options → Files & Links:

  • a boolean Use [[Wikilinks]] for images, corresponding to Use [[Wikilinks]]
  • New image link format, corresponding to New link format, with the same “Relative path to file”, “Absolute path in vault” and “Shortest path when possible” options.

That way, I could have all my image links be relative, standard markdown links, and working with Pandoc would be much easier.

A vault-wide search and replace with regular expressions (use it in Notepad++, Sublime Text or any other capable text editor) could do this:

Search: !(\[\[)(.*?)([.])(png|jpg|jpeg|bmp|gif|tiff|anyotherimagetype)(\]\])
Replace: ![](<attach/$2$3$4>)

The anyotherimagetype if unchanged, can be left there – it doesn’t make any difference.
Obviously any major overhaul like this must be advanced with caution but this regex is stringent and safe enough to use and should work, provided that the attachment folder is called attach and all images files are in that folder.

1 Like

I used Typora to export as PDF or Word, the regular expression I used is:
Search: !(\[\[)(.*?)([.])(png|jpg|jpeg|bmp|gif|tiff)(\]\])
Replace: ![]\(D:\\obsidian\\attachments\\$2$3$4\)

D:\obsidian\attachments is the absolute path, usually I make a copy of the file that needs to be exported and leave the obsidian origin alone