torchbox / wagtail-markdown

Markdown support for Wagtail
zlib License
198 stars 66 forks source link

How to change the default rendition of image? #137

Open yuhr123 opened 10 months ago

yuhr123 commented 10 months ago

I know that the default width for images is width-500, but this is too small for general use.

Anyone could tell me how to change the width to width-1000?

zerolab commented 10 months ago

Please see https://github.com/torchbox/wagtail-markdown#inline-links

yuhr123 commented 10 months ago

Please see https://github.com/torchbox/wagtail-markdown#inline-links

Hi @zerolab, thank you for your information. Yes, I am aware that I can use ![](image:123, filter=witdh-xxx) to specify a specific rendition for an image. However, I would like to change the default value for all images inserted into the markdown block. Do you have any suggestions?

zerolab commented 10 months ago

At the moment, there is no way to override that - https://github.com/torchbox/wagtail-markdown/blob/5b64706d203536c4eec9352f2f9645d52e9095d6/src/wagtailmarkdown/mdx/inlinepatterns.py#L103

I'd be happy to review a PR that adds another configuration option (default_image_filter or something along those lines) and uses that in https://github.com/torchbox/wagtail-markdown/blob/5b64706d203536c4eec9352f2f9645d52e9095d6/src/wagtailmarkdown/mdx/inlinepatterns.py#L103

yuhr123 commented 10 months ago

I'd be happy to review a PR that adds another configuration option (default_image_filter or something along those lines) and uses that in

👍 Looks good, I am looking forward it.