Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image support for resize #143

Closed
Dexus opened this issue Mar 23, 2015 · 8 comments
Closed

image support for resize #143

Dexus opened this issue Mar 23, 2015 · 8 comments

Comments

@Dexus
Copy link

Dexus commented Mar 23, 2015

hi some markdown dialects support sizes (like the following)

![](./pic/pic1_50.png =100x20)

is ther a plan to support it?

@tivie
Copy link
Member

tivie commented Apr 22, 2015

Hello @Dexus. Although it is a nice feature, the original specification does not include it. I believe this should be implemented as post-processing extension and not in the core library.

@pdeschen
Copy link
Contributor

@tivie as it is not a breaking change addition, maybe it could be part of core?

@ghost
Copy link

ghost commented May 31, 2015

I strongly disagree. Images should have first class support.

@tivie
Copy link
Member

tivie commented Jun 10, 2015

This will probably make it in the next release, as an opt in feature. (means you have to enable it explicitly through options)

@tivie tivie closed this as completed in af82c2b Jun 17, 2015
@tivie
Copy link
Member

tivie commented Jun 17, 2015

Added this feature as an opt in.

To enable it you must use the option parseImgDimensions. Example:

var conv = new showdown.Converter({parseImgDimensions: true});

It supports both inline and reference styles:

![my image](foo.jpg =100x80 "some title")

or

![my image][1]

[1]: foo.jpg =100x80 "some title"

Also you can set the units the dimensions are in (default is pixels (px))

![my image](foo.jpg =100%x80dpi "some title")

@ghost
Copy link

ghost commented Jun 17, 2015

Great stuff, thank you :)

On Wed, 17 Jun 2015 at 01:29 Estevão Soares dos Santos <
[email protected]> wrote:

Added this feature as an opt in. To enable it you must use the option
parseImgDimensions

example:

var conv = new showdown.Converter({parseImgDimensions: true});


Reply to this email directly or view it on GitHub
#143 (comment)
.

@bansalvks
Copy link

bansalvks commented Jun 21, 2016

is it possible that we set the heightonly and the width will be auto calculated, accordingly? So that, the image does not look awkward?

@charlesthk
Copy link

@bansalvks you can do it by specifying a star (*) for example :
![my image](foo.jpg =200x* "some title")
![my image](foo.jpg =*x200 "some title")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants