sanity-plugin-markdown
sanity-plugin-markdown copied to clipboard
Don't add width param to image url, or make it configurable.
When uploading an image to markdown, the plugin adds ?w=450
to the end of the url. My content creators then need to manually strip that url param. In my case, if the width exists in the url, and in my site if I use that url in next/image, next/image will pull the 450 width version of the image, then scale it up to render it how i want. This creates very low resolution images.
I believe this the offending code https://github.com/sanity-io/sanity-plugin-markdown/blob/main/src/components/Editor.jsx#L60
Is it's purpose to render nicely in the preview? I would prefer it totally removed or at least allow configuration so that I can unset it.
In the meantime I am stripping this url param on my app side, which isn't the end of the world but not idea.
Thanks!
Point up for this to be configurable
You are able to do it with the following options now:
defineField({
type: 'markdown',
name: 'markdown',
title: 'Markdown',
options: {
imageUrl: imageAsset => imageAsset.url
}
});