Let’s say I have some images in my markdown. I want to set meta tags with Next.js Head component. Is there any way to get random/all images and set meta tag with its proper og:image with proper source and og:image:width and og:image:height from image dimensions. I see the way to set my image component, but maybe someone solved this problem and can share an example?
IMO this is outside the scope of this package.
You can publish your markdown thusly…

Whatever your mechanism is to retrieve the markdown, you can then feed that to Head as well as react-markdown. But react-markdown itself doesn't really care about this.
CommonMark does not have a mechanism to add additional attributes to links. As such this would not be supported in core.
However there are some solutions:
<img og:image:height="" src="" />