# Images
Syntax for images is like the syntax for links, with one difference. Instead of link text (opens new window), we have an image description (opens new window). The rules for this are the same as for link text (opens new window), except that (a) an image description starts with ![
rather than [
, and (b) an image description may contain links. An image description has inline elements as its contents. When an image is rendered to HTML, this is standardly used as the image’s alt
attribute.
Example 580
Markdown | HTML | Demo |
---|---|---|
|
|
Example 581
Markdown | HTML | Demo |
---|---|---|
|
|
Example 582
Markdown | HTML | Demo |
---|---|---|
|
|
Example 583
Markdown | HTML | Demo |
---|---|---|
|
|
Though this spec is concerned with parsing, not rendering, it is recommended that in rendering to HTML, only the plain string content of the image description (opens new window) be used. Note that in the above example, the alt attribute’s value is foo bar
, not foo [bar](/url)
or foo <a href="/url">bar</a>
. Only the plain string content is rendered, without formatting.
Example 584
Markdown | HTML | Demo |
---|---|---|
|
|
Example 585
Markdown | HTML | Demo |
---|---|---|
|
|
Example 586
Markdown | HTML | Demo |
---|---|---|
|
|
Example 587
Markdown | HTML | Demo |
---|---|---|
|
|
Example 588
Markdown | HTML | Demo |
---|---|---|
|
|
Example 589
Markdown | HTML | Demo |
---|---|---|
|
|
Reference-style:
Example 590
Markdown | HTML | Demo |
---|---|---|
|
|
Example 591
Markdown | HTML | Demo |
---|---|---|
|
|
Collapsed:
Example 592
Markdown | HTML | Demo |
---|---|---|
|
|
Example 593
Markdown | HTML | Demo |
---|---|---|
|
|
The labels are case-insensitive:
Example 594
Markdown | HTML | Demo |
---|---|---|
|
|
As with reference links, whitespace (opens new window) is not allowed between the two sets of brackets:
Example 595
Markdown | HTML | Demo |
---|---|---|
|
|
Shortcut:
Example 596
Markdown | HTML | Demo |
---|---|---|
|
|
Example 597
Markdown | HTML | Demo |
---|---|---|
|
|
Note that link labels cannot contain unescaped brackets:
Example 598
Markdown | HTML | Demo |
---|---|---|
|
|
The link labels are case-insensitive:
Example 599
Markdown | HTML | Demo |
---|---|---|
|
|
If you just want a literal !
followed by bracketed text, you can backslash-escape the opening [
:
Example 600
Markdown | HTML | Demo |
---|---|---|
|
|
If you want a link after a literal !
, backslash-escape the !
:
Example 601
Markdown | HTML | Demo |
---|---|---|
|
|