2022-06-01 20:23:08 -07:00
|
|
|
# Reference Links and Images
|
|
|
|
|
|
|
|
## Valid Links
|
|
|
|
|
|
|
|
Full reference link: [text][label]
|
|
|
|
|
|
|
|
Collapsed reference link: [label][]
|
|
|
|
|
|
|
|
Shortcut reference link: [label]
|
|
|
|
|
|
|
|
Same line: [text][label] [label][] [label]
|
|
|
|
|
|
|
|
Mixed case: [TEXT][LABEL] [LABEL][] [LABEL]
|
|
|
|
|
|
|
|
With spaces: [text][label with spaces] [text][ label with spaces ]
|
|
|
|
|
|
|
|
With nested brackets: [t[ex]t][label]
|
|
|
|
|
|
|
|
With inline content: [*text*][label]
|
|
|
|
|
|
|
|
With inline code span: [`code`][label]
|
|
|
|
|
|
|
|
Shortcut inline code span: [`code`]
|
|
|
|
|
|
|
|
Multi-line full text: [multi
|
|
|
|
line][multi line full text]
|
|
|
|
|
|
|
|
Multi-line full label: [text][multi
|
|
|
|
line full label]
|
|
|
|
|
|
|
|
Multi-line collapsed label: [multi
|
|
|
|
line collapsed label][]
|
|
|
|
|
|
|
|
Multi-line shortcut label: [multi line
|
|
|
|
shortcut label]
|
|
|
|
|
2022-08-01 18:48:01 -07:00
|
|
|
> Multi-line full text: [multi
|
|
|
|
> line][blockquote multi line full text]
|
|
|
|
>
|
|
|
|
> Multi-line full label: [text][blockquote multi
|
|
|
|
> line full label]
|
|
|
|
>
|
|
|
|
> Multi-line collapsed label: [blockquote multi
|
|
|
|
> line collapsed label][]
|
|
|
|
>
|
|
|
|
> Multi-line shortcut label: [blockquote multi line
|
|
|
|
> shortcut label]
|
|
|
|
>
|
|
|
|
> > Multi-line shortcut label: [blockquote blockquote
|
|
|
|
> > multi line shortcut label]
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
Dedicated line:
|
|
|
|
[text][label]
|
|
|
|
|
|
|
|
Dedicated line with trailing colon:
|
|
|
|
[text][label]:
|
|
|
|
|
|
|
|
Shortcut ending in colon: [colon]:
|
|
|
|
|
|
|
|
Use of multi-line label: [multi-line-label][]
|
|
|
|
|
2023-01-12 20:49:31 -08:00
|
|
|
Use of link in label: [link-in-label][]
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
Standard link: [text](https://example.com/standard)
|
|
|
|
|
2022-07-30 16:12:27 -07:00
|
|
|
Wrapped in brackets: [[text][unique0]] [[unique1][]] [[unique2]]
|
|
|
|
|
|
|
|
[Embedded [text][unique3] in [unique4][] brackets [unique5]]
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
## Invalid Links
|
|
|
|
|
|
|
|
Missing label: [text][missing] {MD052}
|
|
|
|
|
|
|
|
Mixed valid/invalid: [text][label] [text][missing] {MD052}
|
|
|
|
|
|
|
|
Missing multi-line label {MD052}: [text][missing
|
|
|
|
label]
|
|
|
|
|
2023-01-12 20:56:27 -08:00
|
|
|
> Missing label in blockquote: [text][missing] {MD052}
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
## Non-Links
|
|
|
|
|
|
|
|
Space: [text] [wrong]
|
|
|
|
|
|
|
|
Empty: [text][ ]
|
|
|
|
|
2022-07-30 16:12:27 -07:00
|
|
|
Code span: `[wrong]`
|
|
|
|
|
|
|
|
Code span: `[wrong][]`
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
Code span: `[text][wrong]`
|
|
|
|
|
2022-07-30 16:12:27 -07:00
|
|
|
Code span: `[[wrong]]`
|
|
|
|
|
|
|
|
Code span: `[[wrong][]]`
|
|
|
|
|
|
|
|
Code span: `[[text][wrong]]`
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
Escaped left text: \[text][wrong]
|
|
|
|
|
|
|
|
Escaped right text: [text\][wrong]
|
|
|
|
|
|
|
|
Escaped left label: [text]\[wrong]
|
|
|
|
|
|
|
|
Escaped right label: [text][wrong\]
|
|
|
|
|
|
|
|
## Valid Images
|
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Full style: ![text][image0]
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Collapsed style: ![image1][]
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Shortcut style: ![image2]
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Image in link: [![text][image3]](link) [![image4][]](link) [![image5]](link)
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Image in shortcut link: [![text][image6]][unique6] [![image7][]][unique7] [![image8]][unique8]
|
2022-07-30 16:12:27 -07:00
|
|
|
|
2022-08-31 22:46:19 -07:00
|
|
|
Wrapped in brackets: [![text][unique9]]
|
|
|
|
|
|
|
|
Embedded [in ![text][unique10] brackets]
|
2022-07-30 16:12:27 -07:00
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
## Invalid Images
|
|
|
|
|
|
|
|
Image only: ![text][missing] {MD052}
|
|
|
|
|
|
|
|
Image in link: [![text][missing]][label] {MD052}
|
|
|
|
|
|
|
|
## Non-Images
|
|
|
|
|
|
|
|
Escaped left text: !\[text][wrong]
|
|
|
|
|
|
|
|
Escaped right text: ![text\][wrong]
|
|
|
|
|
|
|
|
Escaped left label: ![text]\[wrong]
|
|
|
|
|
|
|
|
Escaped right label: ![text][wrong\]
|
|
|
|
|
|
|
|
## Valid Footnotes
|
|
|
|
|
|
|
|
Footnote[^1]
|
|
|
|
|
|
|
|
## Invalid Footnotes
|
|
|
|
|
|
|
|
Missing[^2]
|
|
|
|
|
|
|
|
## Valid Labels
|
|
|
|
|
|
|
|
[label]: https://example.com/label
|
|
|
|
[ label with spaces ]: https://example.com/label-with-spaces
|
|
|
|
[image]:https://example.com/image
|
2022-08-31 22:46:19 -07:00
|
|
|
[image0]: https://example.com/image0
|
|
|
|
[image1]: https://example.com/image1
|
|
|
|
[image2]: https://example.com/image2
|
|
|
|
[image3]: https://example.com/image3
|
|
|
|
[image4]: https://example.com/image4
|
|
|
|
[image5]: https://example.com/image5
|
|
|
|
[image6]: https://example.com/image6
|
|
|
|
[image7]: https://example.com/image7
|
|
|
|
[image8]: https://example.com/image8
|
2022-06-01 20:23:08 -07:00
|
|
|
[`code`]: https://example.com/code
|
|
|
|
[multi line full text]: https://example.com/multi-line-full-text
|
|
|
|
[multi line full label]: https://example.com/multi-line-full-label
|
|
|
|
[multi line collapsed label]: https://example.com/multi-line-collapsed-label
|
|
|
|
[multi line shortcut label]: https://example.com/multi-line-shortcut-label
|
2022-08-01 18:48:01 -07:00
|
|
|
[blockquote multi line full text]: https://example.com/blockquote-multi-line-full-text
|
|
|
|
[blockquote multi line full label]: https://example.com/blockquote-multi-line-full-label
|
|
|
|
[blockquote multi line collapsed label]: https://example.com/blockquote-multi-line-collapsed-label
|
|
|
|
[blockquote multi line shortcut label]: https://example.com/blockquote-multi-line-shortcut-label
|
|
|
|
[blockquote blockquote multi line shortcut label]: https://example.com/blockquote-blockquote-multi-line-shortcut-label
|
2022-06-01 20:23:08 -07:00
|
|
|
[colon]: https://example.com/colon
|
|
|
|
[multi-line-label]:
|
|
|
|
https://example.com/multi-line-label
|
2023-01-12 20:49:31 -08:00
|
|
|
[link-in-label]: https://example.com/path?[brackets][]
|
2022-07-30 16:12:27 -07:00
|
|
|
[unique0]: https://example.com/unique0
|
|
|
|
[unique1]: https://example.com/unique1
|
|
|
|
[unique2]: https://example.com/unique2
|
|
|
|
[unique3]: https://example.com/unique3
|
|
|
|
[unique4]: https://example.com/unique4
|
|
|
|
[unique5]: https://example.com/unique5
|
|
|
|
[unique6]: https://example.com/unique6
|
|
|
|
[unique7]: https://example.com/unique7
|
2022-08-31 22:46:19 -07:00
|
|
|
[unique8]: https://example.com/unique8
|
|
|
|
[unique9]: https://example.com/unique9
|
|
|
|
[unique10]: https://example.com/unique10
|
2023-02-05 16:58:06 -08:00
|
|
|
[^1]: https://example.com/footnote {MD034}
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2022-08-02 20:36:47 -07:00
|
|
|
## Ignored Labels
|
|
|
|
|
|
|
|
[//]: # (This is a technique for putting comments in Markdown)
|
|
|
|
|
|
|
|
[//]: <> (Here is another variant)
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
## Invalid Labels
|
|
|
|
|
2023-01-29 20:36:53 -08:00
|
|
|
Duplicate/unused:
|
2022-06-01 20:23:08 -07:00
|
|
|
|
2023-01-29 20:36:53 -08:00
|
|
|
[label]: {MD053}
|
|
|
|
[blank-line-filler-0]: https://example.com
|
2022-06-01 20:23:08 -07:00
|
|
|
[unused]: {MD053}
|
2023-01-29 20:36:53 -08:00
|
|
|
[blank-line-filler-1]: https://example.com
|
2022-06-01 20:23:08 -07:00
|
|
|
[^3]: {MD053}
|
|
|
|
|
2023-01-29 20:36:53 -08:00
|
|
|
[blank-line-filler-0][] [blank-line-filler-1][]
|
|
|
|
|
2022-06-01 20:23:08 -07:00
|
|
|
[Duplicate unused multi-line label {MD053}]:
|
|
|
|
https://example.com/duplicate-unused-multi-line-label
|
|
|
|
|
|
|
|
[Duplicate unused multi-line label {MD053}]:
|
|
|
|
https://example.com/duplicate-unused-multi-line-label
|
|
|
|
|
|
|
|
\[Escaped left]: text
|
|
|
|
|
|
|
|
[Escaped right\]: text
|
|
|
|
|
|
|
|
## Valid Links and Images after Labels
|
|
|
|
|
|
|
|
Link and image: [text][label] [![text][image]][label]
|
|
|
|
|
|
|
|
## More Invalid Links and Images after Labels
|
|
|
|
|
|
|
|
Bad link with image [![text][image]][missing] {MD052}
|
|
|
|
|
|
|
|
## Shortcut One-Way Handling
|
|
|
|
|
|
|
|
Validates the label: [shortcut]
|
|
|
|
|
|
|
|
[shortcut]: https://example.com/shortcut
|
|
|
|
|
|
|
|
Not flagged due to ambiguity: [ignored]
|
|
|
|
|
|
|
|
## Open Bracket Pairs
|
|
|
|
|
|
|
|
Unmatched [ in text
|
|
|
|
|
|
|
|
Hidden reference: [hidden][] {MD052}
|
2022-10-19 21:12:51 -07:00
|
|
|
|
|
|
|
## Link references inside reference definitions
|
|
|
|
|
|
|
|
Text with a [^footnote] in it
|
|
|
|
|
|
|
|
[^footnote]: Footnote with an [embedded-reference][] in it
|
|
|
|
|
|
|
|
[embedded-reference]: https://example.com/embedded-reference
|
2025-04-27 22:36:07 -07:00
|
|
|
|
|
|
|
## GitHub Flavored Markdown Task List Items
|
|
|
|
|
|
|
|
- [ ] Unchecked task list item
|
|
|
|
- [x] Checked task list item
|