My page contains a large image which stretch beyond the width of this component.
I want the image to contain.
Use a custom renderer for the image type and specify a class name or inline styles:
function Image(props) {
return <img {...props} style={{maxWidth: '100%'}} />
}
<Markdown
source=""
renderers={{image: Image}}
/>
You'll have to figure out the right approach to styling it yourself, but this should give you all the flexibility you need.
Thanks for the custom renderer code. Are there any plans to support scaling like mentioned at https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#images? I may have some time in the future to draft a PR.
Most helpful comment
Use a custom renderer for the
imagetype and specify a class name or inline styles:You'll have to figure out the right approach to styling it yourself, but this should give you all the flexibility you need.