How to Customize Image Size in MD2Card

xiaohongshu card
MD2Card extends Markdown syntax to support custom image sizing
How to Customize Image Size in MD2Card

By extending Markdown syntax, MD2Card enables custom image sizes.

Markdown Syntax

![alt|400x300](url)

Example

![Coffee Shop|200x200](https://images.unsplash.com/photo-1499750310107-5fef28a66643?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=420&q=80)

Result

Notes:

  • Pure numbers default to px: 800x600 parses as 800px x 600px
  • You can set either width or height; the other dimension auto-scales