### HTML for Numbered Example Source: https://github.com/commonmark/commonmark-spec/wiki/Proposed-Extensions-to-CommonMark Mark a specific example with a paragraph element, assigning a class 'example' and an ID for referencing. ```html5
example
``` -------------------------------- ### CommonMark Example Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt This is the equivalent CommonMark syntax for the AsciiDoc example, demonstrating its readability. ```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. ``` -------------------------------- ### Delimiter Runs: Both Left and Right-Flanking Examples Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Examples of delimiter runs that are both left-flanking and right-flanking. ```text abc***def "abc"_"def" ``` -------------------------------- ### Markdown Example: List Item with Blank Line Source: https://github.com/commonmark/commonmark-spec/blob/master/changelog.txt Example of a list item starting with a blank line that contains spaces. ```markdown Add example for list item starting with a blank line with spaces (Robin Stocker). ``` -------------------------------- ### Anonymous and Named Numbered Examples Syntax Source: https://github.com/commonmark/commonmark-spec/wiki/Deployed-Extensions Syntax for creating anonymous and named numbered examples, useful for linguistic articles or documents requiring sequential referencing. References are made using the '@' symbol. ```CommonMark (@) anonymous numbered example ``` ```CommonMark (@id) named numbered example ``` -------------------------------- ### Delimiter Runs: Neither Left nor Right-Flanking Examples Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Examples of delimiter runs that are neither left-flanking nor right-flanking. ```text abc *** def a _ b ``` -------------------------------- ### Delimiter Runs: Left-Flanking Examples Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Examples of delimiter runs that are left-flanking but not right-flanking. ```text ***abc _abc **"abc" _"abc" ``` -------------------------------- ### Delimiter Runs: Right-Flanking Examples Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Examples of delimiter runs that are right-flanking but not left-flanking. ```text abc*** abc_ "abc"** "abc"_ ``` -------------------------------- ### Explicit Numbered List Syntax Source: https://github.com/commonmark/commonmark-spec/wiki/Deployed-Extensions Demonstrates explicit numbering in enumerated lists using dots and parentheses, with examples for starting values and fixed values. ```markdown 2. two 4. three ____ 2) two 4) four ``` -------------------------------- ### AsciiDoc Example Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt This is an example of AsciiDoc syntax for a list with nested elements 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. -- ``` -------------------------------- ### Settings Extension Example Source: https://github.com/commonmark/commonmark-spec/wiki/Generic-Directive-Extension-List Illustrates the 'settings' extension, which allows for configuring extensions. The available settings depend on the specific extension being configured. ```markdown extensionName.settings: () {available settings Dependent on extension} ``` -------------------------------- ### Markdown Example: Unicode Whitespace Source: https://github.com/commonmark/commonmark-spec/blob/master/changelog.txt Examples and test cases to ensure correct handling of Unicode whitespace distinctions. ```markdown Add examples for Unicode whitespace (Timothy Gu). In light of commonmark/commonmark.js#107, add a few examples/test cases to make sure the distinction between Unicode whitespace and regular whitespace is kept. ``` -------------------------------- ### URI Autolink Example Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Demonstrates a basic URI autolink. Ensure the URI is enclosed in angle brackets. ```markdown``` -------------------------------- ### Basic HTML Tags Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Demonstrates the parsing of simple HTML open tags and custom tags. ```CommonMark
one
two
Markdown
foo
``` ```CommonMark foo foo --> foo foo --> .foo foo -->
foo foo -->
``` -------------------------------- ### Custom HTML Tag Names Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Demonstrates the use of custom tag names in HTML. ```CommonMark FooFoo
aaa
bbb
``` -------------------------------- ### HTML for Frontmatter Section Source: https://github.com/commonmark/commonmark-spec/wiki/Proposed-Extensions-to-CommonMark Employ a section element with a 'frontmatter' class for introductory content preceding the main body. ```html5<33> <__>
``` -------------------------------- ### Consecutive Emphasis Sections Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Shows an example where two consecutive emphasis sections are not formed due to delimiter rules. ```markdown *foo**bar* .foo**bar
``` -------------------------------- ### Link Syntax Sugar: Shortcut Reference Links Source: https://github.com/commonmark/commonmark-spec/wiki/Proposed-Extensions-to-CommonMark Creates an HTML anchor link with an explicit href attribute. ```html Reference ``` -------------------------------- ### Link Reference Definition and Usage Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Demonstrates how a link reference definition is parsed and then used within the document. ```markdown [foo]: /url bar === [foo] . ``` ```htmlfoo ___
``` ```markdown foo _\__ .foo _
``` ```markdown foo _*_ .foo *
``` ```markdown foo _____ .foo _____
``` ```markdown foo __\___ .foo _
``` ```markdown foo __*__ .foo *
``` ```markdown __foo_ ._foo
``` ```markdown _foo__ .foo_
``` ```markdown ___foo__ ._foo
``` ```markdown ____foo_ .___foo
``` ```markdown __foo___ .foo_
``` ```markdown _foo____ .foo___
``` ```markdown __foo__ .foo
``` ```markdown __ . ``` -------------------------------- ### HTML Block with Incomplete Tag Syntax Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt An HTML block starting with a tag that has incomplete syntax. Content is treated as raw HTML. ```htmlThe number of windows in my house is
foo bar
``` -------------------------------- ### Spoiler Directive Example Source: https://github.com/commonmark/commonmark-spec/wiki/Generic-Directive-Extension-List Demonstrates the 'spoiler' extension for hiding content. The content field is used for the spoiler text, and no arguments or key-value pairs are specified. ```markdown spoiler: Spoiler Text () ``` -------------------------------- ### Preventing Spurious List Capture with Non-1 Number Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Shows that only lists starting with '1' can interrupt paragraphs; other numbers will be treated as part of the preceding paragraph. ```markdown The number of windows in my house is 14. The number of doors is 6. ``` ```htmlThe number of windows in my house is 14. The number of doors is 6.
``` -------------------------------- ### Tight List with Code Block Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt 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 . ``` -------------------------------- ### Emphasis and Strong Emphasis - Nested Delimiters Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Shows how nested emphasis and strong emphasis are handled, requiring different delimiters for direct nesting of the same type. ```markdown **foo** .foo
``` ```markdown *_foo_* .foo
``` ```markdown _*foo*_ .foo
``` ```markdown ****foo**** .foo
``` ```markdown ____foo____ .foo
``` ```markdown ******foo****** .foo
``` -------------------------------- ### List item indentation with blank line Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Shows that the number of spaces after a list marker does not affect indentation when the list item starts with a blank line. ```commonmark - foo ``` ```html``` -------------------------------- ### ATX Heading - Closing sequence preceded by space Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt The closing '#' sequence must be preceded by a space or tab. ```markdown # foo# ``` -------------------------------- ### Fenced Code Block with Internal Spaces in Fence Source: https://github.com/commonmark/commonmark-spec/blob/master/spec.txt Code fences cannot contain internal spaces or tabs. This example shows how a space within the fence is treated as content. ```markdown ``` ``` aaa ``` ```htmlFoo
bar baz
aaa