# MultiMarkdown Link and Reference Image Attributes

**URL:** <https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916>\
**Category:** Spec\
**Created:** [November 19, 2015, 12:29am UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916 "2015-11-19T00:29:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToniWonKanobi](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/toniwonkanobi/32/777_2.png) [@ToniWonKanobi](https://talk.commonmark.org/u/ToniWonKanobi)\
**Post date:** [November 19, 2015, 12:29am UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/1 "2015-11-19T00:29:44Z")

</div>

CommonMark has yet to implement the popular MultiMarkdown v2+ feature, “[Link and Image Attributes](http://fletcher.github.io/MultiMarkdown-5/syntax.html#linkandimageattributes).”

Consider the following Markdown:

```auto
This is an ![image][] link and a regular hypertext [link][].

[image]: http://path.to/image "Image title" 
[link]: http://path.to/link.html "Some Link"

```

We’re all pretty familiar with this (it’s part of the original John Gruber [spec](http://daringfireball.net/projects/markdown/syntax#img)).

But what if I wanted to apply attributes to the image, like `width="100%"`, or `class="big"`, I would have to use an `<img>` tag instead.

MultiMarkdown allows this:

```auto
This is an ![image][] link and a regular hypertext [link][], with attributes.

[image]: http://path.to/image "Image title" width=100% class=big style="border: solid black 1px;"
[link]: http://path.to/link.html "Some Link" class=external

```

So we could use basically the same syntax that we’re used to for reference image links and hypertext links 🙂

---

<div class="post-metadata">

**Author:** ![Crissov](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/crissov/32/1455_2.png) [@Crissov](https://talk.commonmark.org/u/Crissov)\
**Post date:** [November 19, 2015, 1:11am UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/2 "2015-11-19T01:11:06Z")

</div>

Nobody likes named attributes in markdown, although [some generic syntax](http://talk.commonmark.org/t/consistent-attribute-syntax/272) is being proposed (mostly by people with a strong coding background) on a regular basis. Special alternatives for [image dimensions](http://talk.commonmark.org/t/support-for-image-dimensions/148) have already been discussed. If they were deemed useful, [classes and IDs](http://talk.commonmark.org/t/mermaid-generation-of-diagrams-and-flowcharts-from-text-in-a-similar-manner-as-markdown/1882/19) in reference link definitions and code block info strings would probably be preceded by dot `.` and hash sign `#`, respectively.

```
[image]: <http://path.to/image> "Image title" =100%* .big
```

---

<div class="post-metadata">

**Author:** ![ToniWonKanobi](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/toniwonkanobi/32/777_2.png) [@ToniWonKanobi](https://talk.commonmark.org/u/ToniWonKanobi)\
**Post date:** [November 19, 2015, 1:24am UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/3 "2015-11-19T01:24:24Z")

</div>

That seems acceptable. But it also seems like obfuscation just for obfuscation’s sake. In other words, why use `.` when `class=""` is easier to understand without pouring over the spec?

Conceptually it’s not difficult to equate `#big` as the same thing as `id="big"`, but it does add an extra level of complexity.

That’s why the MMD implementation is nice: `width=100px` (admittedly, I wish they would just do `width="100px"`).

---

<div class="post-metadata">

**Author:** ![Crissov](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/crissov/32/1455_2.png) [@Crissov](https://talk.commonmark.org/u/Crissov)\
**Post date:** [November 19, 2015, 9:25am UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/4 "2015-11-19T09:25:33Z")

</div>

You are assuming HTML output and knowledge here, when you should assume neither.

---

<div class="post-metadata">

**Author:** ![ToniWonKanobi](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/toniwonkanobi/32/777_2.png) [@ToniWonKanobi](https://talk.commonmark.org/u/ToniWonKanobi)\
**Post date:** [November 19, 2015, 6:09pm UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/5 "2015-11-19T18:09:45Z")

</div>

I hope you don’t think I’m being argumentative, but I don’t think anyone could use Markdown without some basic HTML knowledge. Yes, Markdown is designed to be a markup language for HTML. Yes, it is designed to be more inherently readable than HTML.

But suggesting that a Markdown (CommonMark) user requires no prior/previous/“assumed” HTML knowledge is like saying an ALMS GT3 driver requires no knowledge of driving a road car on the road.

Right?

---

<div class="post-metadata">

**Author:** ![Brian\_Lalonde](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/brian_lalonde/32/1565_2.png) [@Brian\_Lalonde](https://talk.commonmark.org/u/Brian_Lalonde)\
**Post date:** [November 19, 2015, 6:54pm UTC](https://talk.commonmark.org/t/multimarkdown-link-and-reference-image-attributes/1916/6 "2015-11-19T18:54:01Z")

</div>

No, I don’t think so. I think it’s intended to be a format that starts as plain text, may never leave that format, or may jump straight to PDF, LaTeX, RTF or another non-HTML format. HTML support is important for advanced usage, but CommonMark should probably avoid HTML-centric assumptions and focus on the content, with minimal style distractions. That’s what formats like AsciiDoc are for.

If class support is added, the leading dot notation matches the CSS selector, leaving fewer syntax alternatives to remember, though classes feel like excessive styling.
