### Ordered List HTML Output Source: https://github.github.com/gfm The HTML rendering of the ordered list example, demonstrating how different delimiters are handled and how the start attribute is applied. ```html
  1. foo
  2. bar
  1. baz
``` -------------------------------- ### Bulleted List Example Source: https://github.github.com/gfm Demonstrates a simple bulleted list using hyphens and plus signs. Different bullet markers start new lists. ```markdown - foo - bar + baz ``` -------------------------------- ### Ordered List Example Source: https://github.github.com/gfm Shows an ordered list with different delimiters. The start number of an ordered list is determined by its initial list item. ```markdown 1. foo 2. bar 3) baz ``` -------------------------------- ### Markdown Equivalent Example Source: https://github.github.com/gfm The Markdown equivalent of the provided AsciiDoc example, demonstrating readability of Markdown source. ```markdown 1. List item one. List item one continued with a second paragraph followed by an Indented block. $ ls *.sh $ mv *.sh ~\/tmp List item continued with a third paragraph. 2. List item two continued with an open block. This paragraph is part of the preceding list item. 1. This list is nested and does not require explicit item continuation. This paragraph is part of the preceding list item. 2. List item b. This paragraph belongs to item two of the outer list. ``` -------------------------------- ### AsciiDoc Example Source: https://github.github.com/gfm An example of AsciiDoc syntax for a list with nested items and indented blocks. ```asciidoc 1. List item one. + List item one continued with a second paragraph followed by an Indented block. + ................. $ ls *.sh $ mv *.sh ~\/tmp ................. + List item continued with a third paragraph. 2. List item two continued with an open block. + -- This paragraph is part of the preceding list item. a. This list is nested and does not require explicit item continuation. + This paragraph is part of the preceding list item. b. List item b. This paragraph belongs to item two of the outer list. -- ``` -------------------------------- ### Empty List Item Example Source: https://github.github.com/gfm Presents an example of an empty list item to clarify its validity and parsing. ```markdown * a * * b ``` -------------------------------- ### Basic HTML Block Example Source: https://github.github.com/gfm Illustrates a basic HTML block of type 6, starting with a tag and ending with a blank line. The content inside the table is rendered as is. ```markdown
hi
okay. ``` ```markdown
hi

okay.

``` -------------------------------- ### Left-Flanking Delimiter Run Examples Source: https://github.github.com/gfm Examples of delimiter runs that are left-flanking but not right-flanking, illustrating conditions for opening emphasis. ```markdown ***abc _abc **"abc" _"abc" ``` -------------------------------- ### Both Left and Right-Flanking Delimiter Run Examples Source: https://github.github.com/gfm Demonstrates delimiter runs that are both left-flanking and right-flanking, indicating potential for emphasis. ```markdown abc***def "abc"_"def" ``` -------------------------------- ### List Item with Section Heading Example Source: https://github.github.com/gfm Shows an example of a list item containing a section heading, highlighting implementation differences. ```markdown - # Heading ``` -------------------------------- ### Right-Flanking Delimiter Run Examples Source: https://github.github.com/gfm Examples of delimiter runs that are right-flanking but not left-flanking, illustrating conditions for closing emphasis. ```markdown abc*** abc_ "abc"** "abc"_ ``` -------------------------------- ### Indented Code Block with Mixed Spaces and Tabs Source: https://github.github.com/gfm This example shows an indented code block starting with spaces and followed by a tab, demonstrating how both are handled for indentation. ```CommonMark foo →bar ``` ```HTML
foo
bar
``` -------------------------------- ### Running Markdown Spec Tests Source: https://github.github.com/gfm Provides a command-line example for running Markdown specification tests using a Python script. ```bash python test/spec_tests.py --spec spec.txt --program PROGRAM ``` -------------------------------- ### URI Autolink Example Source: https://github.github.com/gfm Demonstrates a basic URI autolink. Ensure the URI is absolute and enclosed in angle brackets. ```markdown ``` ```html

http://foo.bar.baz

``` -------------------------------- ### Emphasis with underscore Source: https://github.github.com/gfm Demonstrates emphasis with an underscore. This example shows how `_` can be used for emphasis and how it's parsed. ```markdown foo *_* ``` -------------------------------- ### Multiple Link Reference Definitions Example Source: https://github.github.com/gfm Shows a scenario with multiple definitions for the same link reference, questioning which definition takes precedence. ```markdown [foo]: /url1 [foo]: /url2 [foo][] ``` -------------------------------- ### Nonentities Example Source: https://github.github.com/gfm Examples of strings that are not recognized as valid entity or numeric character references. ```text   &x; &#; &#x; � &#abcdef0; &ThisIsNotDefined; &hi?; ``` ```html

&nbsp &x; &#; &#x; � &#abcdef0; &ThisIsNotDefined; &hi?;

``` -------------------------------- ### Indentation for Sublists Example Source: https://github.github.com/gfm Illustrates a question regarding the required indentation for sublists in Markdown. ```markdown paragraph code? ``` -------------------------------- ### Indented and Right-Aligned List Markers Example Source: https://github.github.com/gfm Shows examples of indented and right-aligned ordered list markers, questioning their validity and parsing. ```markdown 8. item 1 9. item 2 10. item 2a ``` -------------------------------- ### List Item with Continuation Paragraph Example Source: https://github.github.com/gfm Shows an example where a continuation paragraph ('bar') is not indented as far as the first paragraph ('foo'), illustrating a case that the proposed dynamic indentation rule would handle as a single list item. ```markdown 10. foo bar ``` -------------------------------- ### Neither Left nor Right-Flanking Delimiter Run Examples Source: https://github.github.com/gfm Illustrates delimiter runs that are neither left-flanking nor right-flanking, where emphasis is typically not applied. ```markdown abc *** def a _ b ``` -------------------------------- ### Markdown Multi-Level List Structure Source: https://github.github.com/gfm Presents a Markdown example with multiple levels of nested lists, demonstrating structure. ```markdown - a - b - c - d - e - f ``` -------------------------------- ### Spurious List Capture Example Source: https://github.github.com/gfm An example where a list starting with '1.' interrupts a paragraph, resulting in unintended list parsing. This highlights a potential edge case. ```markdown The number of windows in my house is 1. The number of doors is 6. ``` -------------------------------- ### Localhost Autolink Source: https://github.github.com/gfm Example of an autolink for a localhost address with a port and path. This is treated as a valid URI. ```markdown ``` ```html

localhost:5001/foo

``` -------------------------------- ### Inline Structure Precedence Example Source: https://github.github.com/gfm Raises questions about the precedence rules for inline structure markers, specifically between links and backticks. ```markdown [a backtick (`)](/url) and [another backtick (`)](/url). ``` -------------------------------- ### Emphasis and Strong Emphasis Precedence Example Source: https://github.github.com/gfm Explores the precedence rules for emphasis and strong emphasis markers, showing a potentially ambiguous case. ```markdown *foo *bar* baz* ``` -------------------------------- ### GFM Plain Text Example Source: https://github.github.com/gfm Illustrates how GFM parses characters not otherwise interpreted as plain textual content. ```markdown hello $.;'there ``` ```html

hello $.;'there

``` -------------------------------- ### HTML Entity References Example Source: https://github.github.com/gfm Demonstrates various HTML entity references. These are recognized in most contexts except code blocks and spans. ```text   & © Æ Ď ¾ ℋ ⅆ ∲ ≧̸ ``` ```html

  & © Æ Ď ¾ ℋ ⅆ ∲ ≧̸

``` -------------------------------- ### Basic Ordered List Item Example Source: https://github.github.com/gfm Demonstrates a basic ordered list item with a paragraph, indented code, and a blockquote. The indentation of subsequent lines is crucial for correct parsing. ```markdown A paragraph with two lines. indented code > A block quote. ``` ```html

A paragraph with two lines.

indented code

A block quote.

``` -------------------------------- ### Basic Code Span Example Source: https://github.github.com/gfm Demonstrates a simple code span using single backticks. Line endings within the span are converted to spaces. ```markdown `foo` ``` -------------------------------- ### Ordered List with Large Start Number Source: https://github.github.com/gfm Demonstrates an ordered list item with a start number that is nine digits long. This is the maximum allowed length for ordered list start numbers. ```markdown 123456789. ok ``` -------------------------------- ### List Item Starting with Blank Line Source: https://github.github.com/gfm GFM allows list items to start with a blank line, which is then followed by content. The indentation rules apply to subsequent lines. ```markdown - foo - ``` bar ``` - baz ``` ```html ``` ```markdown - foo ``` ```html ``` ```markdown - foo ``` ```html

foo

``` -------------------------------- ### Loose vs. Tight List Item Paragraphs Example Source: https://github.github.com/gfm Demonstrates ambiguity in determining when list items should be wrapped in

tags, specifically concerning 'loose' and 'tight' list structures. ```markdown 1. one 2. two 3. three ``` ```markdown 1. one - a - b 2. two ``` -------------------------------- ### Markdown Strong Emphasis Examples Source: https://github.github.com/gfm Demonstrates various ways to achieve strong emphasis using triple asterisks or underscores, including nested emphasis. ```markdown ***strong emph*** ***strong** in emph* ***emph* in strong** **in strong *emph*** *in emph **strong*** ``` -------------------------------- ### Strong emphasis with underscore Source: https://github.github.com/gfm Shows strong emphasis with an underscore. This example demonstrates how `__` is used for strong emphasis and `_` is parsed. ```markdown foo **_** ``` -------------------------------- ### Markdown Loose List Example Source: https://github.github.com/gfm Illustrates a loose list where a blank line between list items causes them to be parsed as separate paragraphs. ```markdown - a - b - c ``` -------------------------------- ### Strong emphasis with underscore (variant) Source: https://github.github.com/gfm Shows strong emphasis with an underscore. This example demonstrates how `__` is used for strong emphasis and `_` is parsed. ```markdown foo __ _ __ ``` -------------------------------- ### Deeply nested emphasis and strong emphasis Source: https://github.github.com/gfm Demonstrates indefinite levels of nesting for emphasis and strong emphasis. This example shows a complex structure of nested `*` and `**`. ```markdown *foo **bar *baz* bim** bop* ``` -------------------------------- ### Deeply nested strong emphasis and emphasis Source: https://github.github.com/gfm Demonstrates indefinite levels of nesting for strong emphasis and emphasis. This example shows a complex structure of nested `**` and `*`. ```markdown **foo *bar **baz** bim* bop** ``` -------------------------------- ### Emphasis with literal asterisks Source: https://github.github.com/gfm Demonstrates how literal asterisks are handled when they do not form valid emphasis delimiters. This example shows `***` as literal text. ```markdown foo *** ``` -------------------------------- ### GFM Emphasis and Strong Emphasis Examples Source: https://github.github.com/gfm Demonstrates how different combinations of asterisks and underscores are interpreted as emphasis or strong emphasis in GFM. Note how unmatched delimiters appear as literals. ```markdown __*__ ``` ```markdown __foo_ ``` ```markdown _foo__ ``` ```markdown ___foo__ ``` ```markdown ____foo_ ``` ```markdown __foo___ ``` ```markdown _foo____ ``` ```markdown **foo** ``` ```markdown *_foo_* ``` ```markdown __foo__ ``` ```markdown _*foo*_ ``` ```markdown ****foo**** ``` ```markdown ____foo____ ``` ```markdown ******foo****** ``` ```markdown ***foo*** ``` ```markdown _____foo_____ ``` ```markdown *foo _bar* baz_ ``` ```markdown *foo __bar *baz bim__ bam* ``` ```markdown **foo **bar baz** ``` ```markdown *foo *bar baz* ``` ```markdown *[bar*](/url) ``` ```markdown _foo [bar_](/url) ``` ```markdown * ``` ```markdown ** ``` ```markdown __ ``` ```markdown *a `*`* ``` ```markdown _a `_`_ ``` ```markdown **a ``` ```markdown __a ``` -------------------------------- ### Invalid Ordered List Start Number Source: https://github.github.com/gfm GFM does not support negative numbers as start numbers for ordered lists; they are rendered as plain text. ```markdown -1. not ok ``` ```html

-1. not ok

``` -------------------------------- ### Strong emphasis with nested emphasis Source: https://github.github.com/gfm Demonstrates strong emphasis containing nested emphasis. This example uses `__` for strong emphasis and `_` for emphasis. ```markdown __foo _bar_ baz__ ``` -------------------------------- ### Hexadecimal Numeric Character References Example Source: https://github.github.com/gfm Illustrates hexadecimal numeric character references. These are parsed as their corresponding Unicode characters. ```text " ആ ಫ ``` ```html

" ആ ಫ

``` -------------------------------- ### Link with Unbalanced Parentheses Requiring Escaping Source: https://github.github.com/gfm An example demonstrating that unbalanced parentheses in the destination must be escaped or the link may not be formed correctly. ```markdown [link](foo\(and\(bar\)) ``` ```html

link

``` -------------------------------- ### Longer Closing Fence Example Source: https://github.github.com/gfm Demonstrates a valid fenced code block where the closing fence is longer than the opening fence. ```markdown ~~~~ aaa ~~~ ~~~~ ``` ```html
aaa
~~~
``` -------------------------------- ### Non-empty strong emphasis with link Source: https://github.github.com/gfm Illustrates strong emphasis containing a link. This example adheres to the rule that strong emphasis must contain non-empty inline content. ```markdown **foo [bar](/url)** ``` -------------------------------- ### Email Autolink Example Source: https://github.github.com/gfm A standard email address enclosed in angle brackets, parsed as a mailto link. ```markdown ``` ```html

foo@bar.example.com

``` -------------------------------- ### Invalid Link Syntax with Unmatched Angle Brackets Source: https://github.github.com/gfm Examples of link syntax that are not recognized as links due to improperly matched angle brackets in the destination. ```markdown [a]( [a](c) ``` ```html

[a](<b)c [a](<b)c> [a](<b>c)

``` -------------------------------- ### Markdown Less Supported Emphasis Examples Source: https://github.github.com/gfm Illustrates less common but useful patterns for emphasis with nested emphasis, often seen in bibliography entries. ```markdown *emph *with emph* in it* **strong **with strong** in it** ``` -------------------------------- ### List Starting or Ending with Empty Item Source: https://github.github.com/gfm A list can begin or end with an empty list item, which is rendered as an empty list element. ```markdown * ``` ```html
``` -------------------------------- ### Basic Markdown Block Quote Source: https://github.github.com/gfm Demonstrates a standard Markdown block quote with a heading and paragraphs. Requires a '>' followed by a space at the start of each line. ```markdown > # Foo > bar > baz ``` -------------------------------- ### Strong emphasis with adjacent emphasis Source: https://github.github.com/gfm Shows strong emphasis with adjacent emphasis. This example uses `**` for strong emphasis and `*` for emphasis, with no space between. ```markdown **foo*bar*baz** ``` -------------------------------- ### Strong emphasis with nested emphasis (variant 2) Source: https://github.github.com/gfm Shows strong emphasis containing emphasis, using `**` and `*`. This example demonstrates how delimiters are matched. ```markdown **foo *bar*** ``` -------------------------------- ### HTML Block Starting with Closing Tag Source: https://github.github.com/gfm Demonstrates an HTML block that begins with a closing tag. This is followed by a Markdown paragraph. ```markdown *foo* ``` ```markdown *foo* ``` -------------------------------- ### Document Tree Structure Example Source: https://github.github.com/gfm Illustrates the hierarchical structure of a document tree during Markdown parsing, showing nested blocks like block quotes and lists. Open blocks are marked with arrows. ```text -> document -> block_quote paragraph "Lorem ipsum dolor\nsit amet." -> list (type=bullet tight=true bullet_char=-) list_item paragraph "Qui *quodsi iracundia*" -> list_item -> paragraph "aliquando id" ``` -------------------------------- ### Indented Code Block with Tabs Source: https://github.github.com/gfm This example demonstrates how tabs are treated as spaces for indentation in an indented code block, showing the resulting HTML structure. ```CommonMark →foo→baz→→bim ``` ```HTML
foo→baz→→bim
``` -------------------------------- ### Link with Unbalanced Parentheses in Angle Brackets Source: https://github.github.com/gfm An example showing that unbalanced parentheses within angle-bracket-enclosed destinations are preserved as literal characters. ```markdown [link]() ``` ```html

link

``` -------------------------------- ### Markdown First Matching Link Reference Source: https://github.github.com/gfm When multiple link reference definitions exist for the same label, the first one encountered is used. This example shows 'bar' linking to '/url1' because it's the first definition for '[foo]'. ```markdown [foo]: /url1 [foo]: /url2 [bar][foo] ``` -------------------------------- ### Unwanted List Capture Prevention Source: https://github.github.com/gfm CommonMark prevents unintended list captures by only allowing lists starting with '1.' to interrupt paragraphs. This example shows a hard-wrapped number that is not parsed as a list. ```markdown The number of windows in my house is 14. The number of doors is 6. ``` -------------------------------- ### Block-Level vs. Inline-Level Structure Precedence Example Source: https://github.github.com/gfm Demonstrates ambiguity in parsing when block-level and inline-level structures interact, particularly with code spans within lists. ```markdown - `a long code span can contain a hyphen like this - and it can screw things up` ``` -------------------------------- ### List Marker Type Change Example Source: https://github.github.com/gfm Illustrates the ambiguity when list markers change from numbers to bullets, questioning if it constitutes one list or two. ```markdown 1. fee 2. fie - foe - fum ``` -------------------------------- ### Indented Code Block in List Item Source: https://github.github.com/gfm This example shows a common Markdown pattern where an indented code block follows a list item. GFM handles indentation measurement relative to the start of the list item's content. ```markdown 1. foo indented code ``` -------------------------------- ### Indented Code Block Example Source: https://github.github.com/gfm Shows a basic indented code block. Each line must be indented by four or more spaces. Blank lines separate indented chunks. ```markdown a simple indented code block ``` ```html
a simple
  indented code block
``` -------------------------------- ### Literal underscores (multiple) Source: https://github.github.com/gfm Shows literal underscores that do not form emphasis. This example uses `_____` which is treated as literal text. ```markdown foo _____ ``` -------------------------------- ### Link Reference Definition within Blockquote Example Source: https://github.github.com/gfm Illustrates whether link references can be defined within blockquotes or list items. ```markdown > Blockquote [foo]. > > [foo]: /url ``` -------------------------------- ### ATX Headings in Markdown Source: https://github.github.com/gfm Demonstrates the syntax for creating ATX headings in Markdown, using 1 to 6 '#' characters followed by a space and the heading text. ```markdown # foo ## foo ### foo #### foo ##### foo ``` -------------------------------- ### Bulleted List HTML Output Source: https://github.github.com/gfm The HTML rendering of the preceding bulleted list example, showing separate unordered lists for different bullet types. ```html
  • foo
  • bar
  • baz
``` -------------------------------- ### Strong emphasis with nested emphasis Source: https://github.github.com/gfm Shows strong emphasis containing nested emphasis. This example uses `***` to denote strong emphasis and `*` for emphasis. ```markdown ***foo** bar* ``` -------------------------------- ### Recognize http/https autolinks Source: https://github.github.com/gfm Autolinks starting with 'http://' or 'https://' followed by a valid domain and optional path are recognized. Extended path validation rules apply. ```markdown http://commonmark.org (Visit https://encrypted.google.com/search?q=Markup+(business)) ``` -------------------------------- ### Markdown List Indentation Example Source: https://github.github.com/gfm Demonstrates how indentation affects list item parsing in Markdown. Items indented more than three spaces can be treated as paragraph continuations. ```markdown - a - b - c - d - e ``` -------------------------------- ### Markdown Shortcut Reference Link with Inline Formatting Source: https://github.github.com/gfm The link text in a shortcut reference link is parsed as inlines. This example shows '*foo* bar' as the link text, which is then used to match the reference definition. ```markdown [*foo* bar] [*foo* bar]: /url "title" ``` -------------------------------- ### Markdown Intraword Emphasis Examples Source: https://github.github.com/gfm Shows how Markdown handles emphasis within words using asterisks, and the restriction to avoid unwanted emphasis with internal underscores. ```markdown internal emphasis: foo*bar*baz no emphasis: foo_bar_baz ``` -------------------------------- ### Basic GFM Table Syntax Source: https://github.github.com/gfm Use this syntax to create a basic table with a header, delimiter row, and data rows. Leading and trailing pipes are recommended for clarity. ```markdown | foo | bar | | --- | --- | | baz | bim | ``` -------------------------------- ### Simple Open Tags Source: https://github.github.com/gfm Demonstrates basic HTML open tags that are parsed and rendered directly. ```html ``` ```html

``` -------------------------------- ### Strong emphasis with nested strong emphasis (consecutive) Source: https://github.github.com/gfm Shows strong emphasis containing nested strong emphasis where delimiters are consecutive. This example uses `**` for both levels. ```markdown **foo **bar**** ``` -------------------------------- ### Block Not Starting with Whitespace or Indented Code Source: https://github.github.com/gfm Blocks starting with 1-3 spaces indent are not treated as list items directly; indentation is removed first, allowing standard list parsing. ```markdown foo bar ``` ```html

foo

bar

``` ```markdown - foo bar ``` ```html
  • foo

bar

``` ```markdown - foo bar ``` ```html
  • foo

    bar

``` -------------------------------- ### Case-Insensitive Label Matching Source: https://github.github.com/gfm Link reference labels are matched case-insensitively. This example shows a definition with an uppercase label and a link using mixed case. ```markdown [FOO]: /url [Foo] ``` ```html

Foo

``` -------------------------------- ### Setext Headings Level 1 and 2 Source: https://github.github.com/gfm Demonstrates basic setext headings. Use '=' for level 1 and '-' for level 2. Ensure text lines are interpretable as paragraphs. ```markdown Foo *bar* ========= Foo *bar* --------- ``` ```html

Foo bar

Foo bar

``` -------------------------------- ### HTML Block with Closing Tag Source: https://github.github.com/gfm A raw HTML block can start with a closing tag. ```html *bar* ``` -------------------------------- ### Decimal Numeric Character References Example Source: https://github.github.com/gfm Shows decimal numeric character references. Invalid Unicode code points and U+0000 are replaced by the REPLACEMENT CHARACTER. ```text # Ӓ Ϡ � ``` ```html

# Ӓ Ϡ

``` -------------------------------- ### HTML Block with Incomplete Tag and Content Source: https://github.github.com/gfm Illustrates an HTML block starting with an incomplete tag ('
  • foo
  • bar

    • baz
    ``` ```html
    • foo

      bar

      • baz
    ``` -------------------------------- ### HTML Block with Invalid Tag Source: https://github.github.com/gfm An HTML block can start with an invalid tag as long as it begins with '(foo)

    ``` -------------------------------- ### Recognize www.autolinks Source: https://github.github.com/gfm Autolinks starting with 'www.' followed by a valid domain are recognized and prefixed with 'http://'. A valid domain consists of alphanumeric characters, underscores, and hyphens, separated by periods. The last two segments cannot contain underscores. ```markdown www.commonmark.org ``` -------------------------------- ### Link Reference Definition with Title Source: https://github.github.com/gfm Shows how to define a link reference with a title and use it. Multiple definitions can appear consecutively. ```markdown [foo]: /foo-url "foo" [bar]: /bar-url "bar" [baz]: /baz-url [foo], [bar], [baz] ``` ```html

    foo, bar, baz

    ``` -------------------------------- ### Strong emphasis with nested strong emphasis Source: https://github.github.com/gfm Shows strong emphasis containing nested strong emphasis. This example uses `__` for both outer and inner strong emphasis. ```markdown __foo __bar__ baz__ ``` -------------------------------- ### Made-up Scheme Autolink Source: https://github.github.com/gfm An example of an autolink with a non-standard but validly formatted scheme. The parser does not validate scheme registration. ```markdown ``` ```html

    made-up-scheme://foo,bar

    ``` -------------------------------- ### Basic Link Reference Definition and Usage Source: https://github.github.com/gfm Defines a link reference 'foo' with a URL and title, then uses it. This is the most common format. ```markdown [foo]: /url "title" [foo] ``` ```html

    foo

    ``` -------------------------------- ### Markdown Escaped Characters Source: https://github.github.com/gfm Provides examples of characters escaped with backslashes, showing they lose their special Markdown meaning. ```markdown \*not emphasized* \
    not a tag \[not a link](/foo) \`not code` 1\. not a list \* not a list \# not a heading \[foo]: /url "not a reference" \ö not a character entity ``` -------------------------------- ### Tilde-Fenced Code Block with Info String Source: https://github.github.com/gfm Illustrates a tilde-fenced code block with an info string that includes special characters. The info string is used to specify the language and starting line number. ```markdown ~~~~ ruby startline=3 $%@#$ def foo(x) return 3 end ~~~~~~~ ``` ```html
    def foo(x)
      return 3
    end
    
    ``` -------------------------------- ### Markdown Link with URL, Query, and Fragment Source: https://github.github.com/gfm Construct a Markdown link that includes a URL, query parameters, and a fragment identifier. ```markdown [link](http://example.com?foo=3#frag) ``` -------------------------------- ### HTML Block with End Tag on Same Line Source: https://github.github.com/gfm The end tag for special HTML blocks can appear on the same line as the start tag. ```html ``` -------------------------------- ### GFM Soft Line Break Example Source: https://github.github.com/gfm Demonstrates a soft line break in GFM, which occurs with a regular newline not preceded by two spaces or a backslash. It's rendered as a line ending in HTML. ```markdown foo baz ``` ```html

    foo baz

    ``` -------------------------------- ### Processing Instructions Source: https://github.github.com/gfm Shows a valid processing instruction, which is rendered as raw HTML. ```html foo ``` ```html

    foo

    ``` -------------------------------- ### HTML Block with Non-Block-Level Tag Source: https://github.github.com/gfm To start an HTML block with a tag not in the block-level list, the tag must be complete and on its own line. ```html *bar* ``` -------------------------------- ### Link Reference Definition with Empty Link Destination Source: https://github.github.com/gfm An example of a link reference definition with an empty link destination specified using angle brackets. This results in an empty href attribute. ```markdown [foo]: <> [foo] ``` ```html

    foo

    ``` -------------------------------- ### Missing Whitespace Source: https://github.github.com/gfm Shows an example where missing whitespace between an attribute value and the next attribute causes the tag not to be parsed as HTML. ```html ``` ```html

    <a href='bar'title=title>

    ``` -------------------------------- ### Markdown Collapsed Reference Link with Inline Formatting Source: https://github.github.com/gfm The link text in a collapsed reference link is parsed as inlines. This example shows '*foo* bar' as the link text, which is then used to match the reference definition. ```markdown [*foo* bar][] [*foo* bar]: /url "title" ``` -------------------------------- ### Thematic Break within a List Item Example Source: https://github.github.com/gfm Presents a scenario to clarify whether a thematic break within a list item creates two separate lists or is part of a single list item. ```markdown * a * * * * * * b ``` -------------------------------- ### Strong emphasis with nested strong emphasis (variant) Source: https://github.github.com/gfm Illustrates strong emphasis with nested strong emphasis, using `____` and `__`. This highlights delimiter matching rules. ```markdown ____foo__ bar__ ``` -------------------------------- ### Markdown Link Label Normalization Source: https://github.github.com/gfm Link label matching is performed on normalized strings, not parsed inline content. This example shows that '[foo!]' does not match '[foo]: /url' because the labels are not equivalent after normalization. ```markdown [bar][foo!] [foo]: /url ``` -------------------------------- ### Invalid Thematic Break Characters Source: https://github.github.com/gfm Shows examples of character sequences that do not form thematic breaks and are instead rendered as paragraphs. ```markdown +++ ``` ```html

    +++

    ``` ```markdown === ``` ```html

    ===

    ``` -------------------------------- ### Declarations Source: https://github.github.com/gfm Demonstrates a valid HTML declaration, which is rendered as raw HTML. ```html foo ``` ```html

    foo

    ``` -------------------------------- ### Markdown Block Quote Interrupted by List Source: https://github.github.com/gfm Shows how omitting '>' before a list item terminates the block quote and starts a new list. ```markdown > - foo - bar ``` -------------------------------- ### GFM Task List Item Syntax Source: https://github.github.com/gfm Demonstrates the basic syntax for creating unchecked and checked task list items in GFM. Use '- [ ]' for unchecked and '- [x]' for checked items. ```markdown - [ ] foo - [x] bar ``` -------------------------------- ### Fenced Code Block with Tildes Source: https://github.github.com/gfm Demonstrates using at least three tildes to create a fenced code block. This is an alternative to using backticks. ```markdown ~~~ <> ~~~ ``` ```html
    <
    >
    
    ``` -------------------------------- ### Markdown Precedence: Full/Compact vs. Shortcut Source: https://github.github.com/gfm Full and compact reference links take precedence over shortcut references. '[foo][bar]' with definitions for both '[foo]' and '[bar]' will resolve to the definition of '[bar]'. ```markdown [foo][bar] [foo]: /url1 [bar]: /url2 ``` -------------------------------- ### Fences with Internal Spaces (Tildes) Source: https://github.github.com/gfm Illustrates that spaces within tilde fences are not allowed and result in the content being rendered as paragraphs. ```markdown ~~~~~~ aaa ~~~ ~~ ``` ```html
    aaa
    ~~~ ~~
    
    ``` -------------------------------- ### Insufficient Thematic Break Characters Source: https://github.github.com/gfm Provides examples where the character sequences are too short to be recognized as thematic breaks, resulting in paragraph rendering. ```markdown -- ** __ ``` ```html

    -- ** __

    ``` -------------------------------- ### Simple Paragraphs Source: https://github.github.com/gfm Demonstrates the basic structure of two separate paragraphs formed by non-blank lines. ```markdown aaa bbb ``` ```html

    aaa

    bbb

    ``` -------------------------------- ### Bullet List Item with Simple Content Source: https://github.github.com/gfm Illustrates a simple bullet list item. The content 'one' is rendered as a list item, while 'two' on a new line without sufficient indentation becomes a separate paragraph. ```markdown - one two ``` ```html
    • one

    two

    ``` -------------------------------- ### Literal asterisks at the end of a line Source: https://github.github.com/gfm Shows literal asterisks at the end of a line that do not form emphasis. This example uses `*****` which is treated as literal text. ```markdown foo ***** ``` -------------------------------- ### GFM Emphasis: Intraword Underscore Disallowed Source: https://github.github.com/gfm Illustrates that intraword emphasis with underscores is disallowed. These examples show cases where underscores do not create emphasis. ```markdown _foo_bar ``` ```html

    _foo_bar

    ``` ```markdown _пристаням_стремятся ``` ```html

    _пристаням_стремятся

    ``` ```markdown _foo_bar_baz_ ``` ```html

    foo_bar_baz

    ``` -------------------------------- ### GFM Emphasis: Nested Underscore Usage Source: https://github.github.com/gfm Shows emphasis within emphasis using underscores. This example highlights how nested emphasis is handled. ```markdown _(_foo_) ``` ```html

    (foo)

    ``` -------------------------------- ### Markdown Precedence: Full/Compact vs. Shortcut (Collapsed) Source: https://github.github.com/gfm A full or collapsed reference link takes precedence over a shortcut reference. '[foo][]' will resolve to the definition of '[foo]', not be treated as a shortcut link. ```markdown [foo][] [foo]: /url1 ``` -------------------------------- ### Empty Setext Heading Not Allowed Source: https://github.github.com/gfm Shows that an empty setext heading (only an underline) is not recognized and is rendered as a paragraph. ```markdown ==== ``` ```html

    ====

    ``` -------------------------------- ### Markdown Tight List with Code Block Source: https://github.github.com/gfm Demonstrates a tight list where blank lines within a code block inside a list item do not make the list loose. ```markdown - a - ``` b ``` - c ``` -------------------------------- ### Literal underscores at the end of a line Source: https://github.github.com/gfm Demonstrates literal underscores at the end of a line that do not form emphasis. This example uses `___` which is treated as literal text. ```markdown foo ___ ``` -------------------------------- ### Entity References in Markdown Links Source: https://github.github.com/gfm Demonstrates entity references within Markdown link syntax, including the URL and title. ```markdown [foo](/föö "föö") ``` ```html

    foo

    ``` -------------------------------- ### Strong emphasis with nested emphasis (mixed delimiters) Source: https://github.github.com/gfm Demonstrates strong emphasis containing emphasis, using mixed delimiters (`**` and `*`). This shows how different delimiter types interact. ```markdown **foo *bar* baz** ``` -------------------------------- ### Adjacent strong emphasis within emphasis Source: https://github.github.com/gfm Shows emphasis with adjacent strong emphasis. This example highlights how consecutive strong emphasis delimiters are handled. ```markdown *foo**bar*** ``` -------------------------------- ### Autolink with path Source: https://github.github.com/gfm Extended 'www.' autolinks can include paths. Zero or more non-space, non-'<' characters are allowed after the domain. ```markdown Visit www.commonmark.org/help for more information. ``` -------------------------------- ### Markdown Shortcut Reference Link with Nested Brackets Source: https://github.github.com/gfm Demonstrates how nested brackets within the link text of a shortcut reference link are handled. '[[*foo* bar]]' results in a link with the text '[foo bar]'. ```markdown [[*foo* bar]] [*foo* bar]: /url "title" ``` -------------------------------- ### Horizontal Rule with Tabs Source: https://github.github.com/gfm Illustrates the creation of a horizontal rule using asterisks and tab characters, showing how tabs are processed in this context. ```CommonMark *→*→* ``` ```HTML
    ``` -------------------------------- ### Ordered List Item with Indentation Source: https://github.github.com/gfm Shows how an ordered list marker ('1.') followed by spaces creates an ordered list item. The content is parsed as a list item, preserving its structure. ```markdown 1. A paragraph with two lines. indented code > A block quote. ``` ```html
    1. A paragraph with two lines.

      indented code
      

      A block quote.

    ``` -------------------------------- ### GFM Table Breaking at Block Element Source: https://github.github.com/gfm Illustrates that a GFM table is terminated by the first empty line or the start of another block-level element, such as a block quote. ```markdown | abc | def | | --- | --- | | bar | baz | > bar ``` -------------------------------- ### Mismatched Opening and Closing Fences (Tildes) Source: https://github.github.com/gfm Demonstrates that a fenced code block opened with tildes must be closed with tildes, not backticks. ```markdown ~~~ aaa ``` ~~~ ``` ```html
    aaa
    ```
    ``` -------------------------------- ### HTML Block with Incomplete Tag Source: https://github.github.com/gfm Shows an HTML block starting with a partial tag that is not fully formed. The parser treats the entire block as literal HTML. ```markdown
    Foo

    Foo

    ``` -------------------------------- ### GFM Strikethrough Syntax Source: https://github.github.com/gfm Shows how to use tildes for strikethrough text in GitHub Flavored Markdown. Note that three or more tildes do not create strikethrough, and new paragraphs break strikethrough parsing. ```markdown ~~Hi~~ Hello, ~there~ world! ``` ```markdown This ~~has a new paragraph~~. ``` ```markdown This will ~~~not~~~ strike. ``` -------------------------------- ### Emphasis with multiple strong emphasis delimiters (extended) Source: https://github.github.com/gfm Shows a more complex case of emphasis with multiple strong emphasis delimiters, demonstrating how consecutive delimiters are parsed. ```markdown foo******bar*********baz ``` -------------------------------- ### List Interrupting Paragraph (CommonMark) Source: https://github.github.com/gfm In CommonMark, a list can interrupt a paragraph without a preceding blank line. This example shows a paragraph followed by a bulleted list. ```markdown Foo - bar - baz ``` -------------------------------- ### HTML Block with Uppercase Tag Source: https://github.github.com/gfm An example of an HTML block using an uppercase tag (DIV). Markdown content within the block is converted to HTML paragraphs. ```markdown
    *Markdown*
    ``` ```markdown

    Markdown

    ``` -------------------------------- ### Inline Link with Title Source: https://github.github.com/gfm A basic inline link with visible text, a destination URI, and an optional title that appears on hover. ```markdown [link](/uri "title") ``` ```html

    link

    ``` -------------------------------- ### Markdown List Item Indentation (1-3 spaces) Source: https://github.github.com/gfm Demonstrates how indenting list items by 1 to 3 spaces preserves their list item structure. Indentation must be consistent across lines of the list item. ```markdown 1. A paragraph with two lines. indented code > A block quote. ``` ```markdown 1. A paragraph with two lines. indented code > A block quote. ``` ```markdown 1. A paragraph with two lines. indented code > A block quote. ``` -------------------------------- ### Empty Fenced Code Block Source: https://github.github.com/gfm An example of an empty fenced code block with a language identifier. This results in an empty 'code' element within a 'pre' tag. ```markdown ````; ```` ``` ```html
    ``` -------------------------------- ### Plain Text URI Source: https://github.github.com/gfm A standard URI not enclosed in angle brackets is rendered as plain text. ```markdown http://example.com ``` ```html

    http://example.com

    ``` -------------------------------- ### List Item with Multiple Blank Lines Source: https://github.github.com/gfm Demonstrates a list item containing blocks separated by more than one blank line. The blank lines are preserved, and the content is correctly parsed as part of the list item. ```markdown - foo bar ``` ```html
    • foo

      bar

    ``` -------------------------------- ### Ordered List with Leading Zeros Source: https://github.github.com/gfm GFM correctly interprets ordered list items even when the starting number has leading zeros, parsing them into a standard ordered list. ```markdown 0. ok ``` ```html
    1. ok
    ``` ```markdown 003. ok ``` ```html
    1. ok
    ``` -------------------------------- ### HTML Block with Div Tag Source: https://github.github.com/gfm Shows an HTML block starting with a
    tag. The content within the div is processed, and Markdown elements like emphasis are parsed. ```markdown
    *hello* ``` ```markdown
    *hello* ``` -------------------------------- ### Markdown Link with Different Title Quote Styles Source: https://github.github.com/gfm Demonstrates using single quotes, double quotes, and parentheses for link titles in Markdown. ```markdown [link](/url "title") [link](/url 'title') [link](/url (title)) ``` -------------------------------- ### Markdown Link Labels with Escaped Brackets Source: https://github.github.com/gfm Link labels can contain brackets if they are backslash-escaped. This example shows that '[ref[]' is treated as a literal label because the inner bracket is not escaped. ```markdown [foo][ref[] [ref[]: /uri ``` -------------------------------- ### Emphasis with nested strong emphasis Source: https://github.github.com/gfm Demonstrates emphasis with a nested strong emphasis section. The `*` delimiter is used for emphasis and `**` for strong emphasis. ```markdown *foo **bar** baz* ``` -------------------------------- ### GFM Strong Emphasis: Double Asterisk with Nested Emphasis Source: https://github.github.com/gfm Demonstrates strong emphasis containing nested emphasis. This example shows how different emphasis types interact. ```markdown *(**foo**)* ``` ```html

    (foo)

    ``` ```markdown **Gomphocarpus (*Gomphocarpus physocarpus*, syn. *Asclepias physocarpa*)** ``` ```html

    Gomphocarpus (Gomphocarpus physocarpus, syn. Asclepias physocarpa)

    ``` ```markdown **foo "*bar*" foo** ``` ```html

    foo "bar" foo

    ``` -------------------------------- ### Markdown Shortcut Reference Link with Unmatched Brackets Source: https://github.github.com/gfm Shows how unmatched brackets within the link text of a shortcut reference link are parsed. '[[bar [foo]' results in '[bar
    foo'. ```markdown [[bar [foo] [foo]: /url ``` -------------------------------- ### GFM Table with Alignment Source: https://github.github.com/gfm Demonstrates GFM table syntax for specifying column alignment using colons in the delimiter row. Left, right, and center alignments are supported. ```markdown | abc | defghi | | :-: | -----------: | | bar | baz | ``` -------------------------------- ### Strong emphasis with nested emphasis (variant) Source: https://github.github.com/gfm Illustrates strong emphasis containing emphasis, using `***` and `*`. This highlights delimiter parsing rules. ```markdown ***foo* bar** ``` -------------------------------- ### Markdown Link Label Ending with Bracket Source: https://github.github.com/gfm A link label ends at the first following closing bracket. This example shows that '*[foo*]' is treated as a link because the label 'foo*' ends at the '*'. ```markdown [foo*]: /url *[foo*] ``` -------------------------------- ### Strong emphasis with unmatched delimiters (leading) Source: https://github.github.com/gfm Demonstrates strong emphasis where the closing delimiter run is shorter than the opening run, resulting in a literal asterisk. This follows Rule 11. ```markdown ***foo** ``` -------------------------------- ### GFM Emphasis: Underscore with Punctuation Source: https://github.github.com/gfm Demonstrates emphasis with underscores when the closing delimiter is followed by punctuation. This case is treated as emphasis. ```markdown _(bar)_. ``` ```html

    (bar).

    ``` -------------------------------- ### Tab Expansion in Indented Code Blocks Source: https://github.github.com/gfm Tabs in lines are not expanded to spaces but behave as if replaced by spaces for indentation in code blocks. This example shows a tab used for indentation. ```CommonMark →foo→baz→→bim ``` ```HTML
    foo→baz→→bim
    
    ``` -------------------------------- ### Markdown Loose List with Empty Item Source: https://github.github.com/gfm Demonstrates a loose list containing an empty list item. ```markdown * a * * c ```