I wholeheartedly disagree with this.
CommonMark is meant for expressing meaning. It’s declarative. Writing
*this is emphasized* doesn’t mean “make the words ‘this is emphasized’ italic”. It’s up to the consumer of the content to determine how the content and meaning expressed in a commonmark document will be presented.
And if you want images to include dimensions I have two suggestions:
- use HTML,
<img src="..." alt="..." width="..." height="..."> is not difficult to write if you want to be explicit.
- use a post-processor.
I definitely recommend #2. CommonMark shouldn’t be overly concerned about specific implementation details, and why bother wasting an author’s time with information that code can easily detect automatically?
It’d be a simple matter of:
- parsing the HTML
- finding all the
- reading in each of their sources
- setting the
width attributes to the dimensions of the source
Of course, you may need to do something custom to handle SVG, but that’s the beauty of a post-processor. You can make it do whatever you want, or even add parameters to make it have customizable behavior.