# Internal references (anchors) with multiple types

**URL:** <https://talk.commonmark.org/t/internal-references-anchors-with-multiple-types/530>\
**Category:** Extensions\
**Created:** [September 9, 2014, 12:07pm UTC](https://talk.commonmark.org/t/internal-references-anchors-with-multiple-types/530 "2014-09-09T12:07:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mofosyne](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mofosyne/32/1438_2.png) [@mofosyne](https://talk.commonmark.org/u/mofosyne)\
**Post date:** [September 9, 2014, 12:43pm UTC](https://talk.commonmark.org/t/internal-references-anchors-with-multiple-types/530/3 "2014-09-09T12:43:35Z")

</div>

This appears to be better off as a generic extension [http://talk.commonmark.org/t/generic-directives-plugins-syntax](http://talk.commonmark.org/t/generic-directives-plugins-syntax)

```
@name[content](arg){#myId .myClass key=val key2="val 2"}

@@@name[content](arg){#myId .myClass key=val key2="val 2"}
      \*Content to pass to extension*\
@@@

```

For consistency, with [http://talk.commonmark.org/t/consistent-attribute-syntax](http://talk.commonmark.org/t/consistent-attribute-syntax) . Note that we refer to id based anchors in `{}` as `{#id}` not `{id}`

```
!mediaType[description](url){#myId .myClass key=val key2="val 2"}

```

- assumed to be image if mediaType left blank

So therefore:

```
 Singular figure:
 @figure[![A voyage to the moon](moon.jpg) ]{ #themoon }
 
 Block figure:
 @@@figure{ #themoon }
    ![A voyage to the moon](moon.jpg)
 @@@

 This links to the figure:
 @figure( #themoon )

```

Where `@figure( #themoon )` prints out the current figure name/number .

* * *

Or if we are adopting multiple levels of specification [Optional syntax](http://talk.commonmark.org/t/optional-syntax/515/4)

We could use your suggested syntax (fixed for consistancy with other threads)

```
![A voyage to the moon](moon.jpg){#fig:themoon}
[This figure](#fig:themoon)

```

But make it part of CommonMark Scholar Extension

* * *

BTW: Do you know that HTML now supports a figure tag & figure caption tag?

[http://www.w3schools.com/tags/tag\_figure.asp](http://www.w3schools.com/tags/tag_figure.asp)  
[http://www.w3schools.com/tags/tag\_figcaption.asp](http://www.w3schools.com/tags/tag_figcaption.asp)

---

_[View the full topic](https://talk.commonmark.org/t/internal-references-anchors-with-multiple-types/530)._
