Identify CIDs in markdown

as a developer of a blockchain-based blog platform where posts are written in markdown I want to identify CIDs in the markdown from posts so that I can use a browser-based IPFS node instead of an http request to our gateway, increasing overall decentralization for our image, audio, and video storage.

Maybe this lib will be useful to you:

1 Like

Definitely helpful.

However, what I’m ideally looking for will allow users to use only the CID in text and have their photo/video/audio load.

Hi @faddat,

In galacteek i wrote a markdown extension so that when you type @CID or @IPFSPATH it generates IPFS links (using the ipfs:// scheme). There’s also custom syntax for images and videos, see the docs here.

I don’t know which language you use, but it’s probably possible to write a markdown extension easily with a custom syntax. You could also parse the raw markdown text and look for CIDs but that seems more hazardous.