mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 21:37:02 +00:00
Support for image resizing #206
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @seanmcilvenna on GitHub (May 7, 2018).
It would be good if Markdig supported image re-sizing.
For example, some implementations of Markdown support the following:
or
The result would be:
<img src="http://example.com/image.jpg" width="250" height="25" />and
<img src="http://example.com/image.jpg" width="250" height="250" />@MisinformedDNA commented on GitHub (May 25, 2018):
Yes, I was just looking for that as well. I read through the CommonMark spec and see that I can use this workaround:
But that's ugly and dirty.
@xoofx commented on GitHub (May 25, 2018):
Not sure it is a good idea to add an extension for changing the CommonMark URL syntax... but you should be able to do this with the special attributes extension. Check this on babelmark with the
markdig (advanced)output:This syntax is supported by pandoc as well.
@MisinformedDNA commented on GitHub (May 25, 2018):
The CommonMark syntax already allows for similar syntax for links
We would just add similar functionality for images
But I see this is not widely supported either. So that's unfortunate.
That said, what is the difference between
markdigandmarkdig (advanced)?@xoofx commented on GitHub (May 25, 2018):
It is configuring markdig pipeline with most of all available extensions (as described here)
@seanmcilvenna commented on GitHub (May 25, 2018):
So, why was this closed? Are we saying this is already supported by "markdig advanced"?
What is the solution that warrants closing this?
@xoofx commented on GitHub (May 25, 2018):
@MisinformedDNA commented on GitHub (May 29, 2018):
@seanmcilvenna The solution is this
(which, ironically enough, isn't supported by any other popular markdown parser either.)
I'm still baffled that there is no widely accepted way of doing this.
@seanmcilvenna commented on GitHub (May 29, 2018):
do you mean that this is currently supported by markdig?
@xoofx commented on GitHub (May 29, 2018):
It is supported by pandoc, which is quite a strong markdown parser in the markdown ecosystem. The extension attributes in markdig is directly inspired from it.
What is supported is the attributes syntax, as described above
If you really want to have your proposed syntax for your projects, it should not be a huge burden for you to develop an extension or to replace entirely the way links are parsed in markdig.
@MisinformedDNA commented on GitHub (May 29, 2018):
@seanmcilvenna Yes,
is supported by markdig. It is an example of the attribute syntax @xoofx is pointing you too.