<div>
```
--------------------------------
### List item with adjusted indentation and content
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
This example demonstrates how indentation adjustments allow for list item formation even when content initially appears to be offset.
```markdown
- foo
bar
```
```html
```
--------------------------------
### Basic Strikethrough Usage
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Use double tildes (~~) to wrap text for strikethrough formatting. This example shows basic usage with a simple sentence.
```markdown
~~Hi~~ Hello, world!
```
```html
Hi Hello, world!
```
--------------------------------
### Basic Code Span Example
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates a simple inline code span. Delimiters are single backticks.
```markdown
```````````````````````````````` example
`foo`
.
foo
````````````````````````````````
```
--------------------------------
### List item starting with a blank line followed by content
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Illustrates that when a list item starts with a blank line, subsequent content on the same line is not considered part of the list item.
```markdown
-
foo
```
```html
foo
```
--------------------------------
### HTML Declarations
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows how HTML declarations are parsed and rendered. The example includes a DOCTYPE declaration for an empty element.
```html
foo
.
foo
```
--------------------------------
### Markdown Emphasis and Strong Emphasis Examples
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Illustrates various combinations of asterisks and underscores for strong emphasis and nested emphasis.
```markdown
***strong emph***
***strong** in emph*
***emph* in strong**
**in strong *emph***
*in emph **strong***
```
```markdown
*emph *with emph* in it*
**strong **with strong** in it**
```
```markdown
internal emphasis: foo*bar*baz
no emphasis: foo_bar_baz
```
--------------------------------
### Render Basic HTML
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Renders a simple HTML string. This is a basic example of text processing.
```html
bar
```
--------------------------------
### Smart Quotes Example
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/smart_punct.txt
Demonstrates conversion of straight double and single quotes to smart quotes. Handles nested quotes.
```markdown
"Hello," said the spider.
"'Shelob' is my name."
```
```markdown
'A', 'B', and 'C' are letters.
```
```markdown
'Oak,' 'elm,' and 'beech' are names of trees.
So is 'pine.'
```
```markdown
'He said, "I want to go."'"
```
--------------------------------
### Invalid ordered list start number (negative)
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Negative numbers are not valid start numbers for ordered lists and will be rendered as plain text.
```markdown
-1. not ok
```
```html
-1. not ok
```
--------------------------------
### List items starting with a blank line
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates list items that begin with a blank line, showing how nested elements like code blocks and block quotes are handled.
```markdown
-
foo
-
```
bar
```
-
baz
```
```html
```
--------------------------------
### Nested Emphasis and Strong Emphasis
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Illustrates various cases of nesting emphasis and strong emphasis. The examples cover different combinations and their correct rendering.
```markdown
_foo __bar__ baz_
.
foo bar baz
```
```markdown
_foo _bar_ baz_
.
foo bar baz
```
```markdown
__foo_ bar_
.
foo bar
```
```markdown
*foo *bar**
.
foo bar
```
```markdown
*foo **bar** baz*
.
foo bar baz
```
```markdown
*foo**bar**baz*
.
foobarbaz
```
--------------------------------
### Extended URL Autolink Examples
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows recognized extended URL autolinks using 'http://', 'https://', and 'ftp://' schemes.
```markdown
http://commonmark.org
(Visit https://encrypted.google.com/search?q=Markup+(business))
Anonymous FTP is available at ftp://foo.bar.baz.
```
```html
http://commonmark.org
(Visit https://encrypted.google.com/search?q=Markup+(business))
Anonymous FTP is available at ftp://foo.bar.baz.
```
--------------------------------
### HTML Block with Incomplete Tag Start
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
An HTML tag start that is not a valid tag can still initiate an HTML block if it begins like a tag.
```html
.
foo@bar.example.com
```
--------------------------------
### Multiple Link Reference Definitions
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Presents a Markdown example with multiple definitions for the same link reference. This highlights the ambiguity in precedence rules when duplicate references exist.
```markdown
[foo]: /url1
[foo]: /url2
[foo][]
```
--------------------------------
### Setext Heading Level 1 and 2 Examples
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates basic setext headings. Level 1 uses '=', Level 2 uses '-'. Inline formatting within the heading text is supported.
```markdown
Foo *bar*
=========
Foo *bar*
---------
```
```html
Foo bar
Foo bar
```
--------------------------------
### Ordered list start number with multiple leading zeros
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Multiple leading zeros in ordered list start numbers are handled correctly, with the number being parsed as its numerical value.
```markdown
003. ok
```
```html
- ok
```
--------------------------------
### Empty List Item
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows a Markdown list with an empty list item. This example questions the validity and rendering of empty list items.
```markdown
* a
*
* b
```
--------------------------------
### Markdown Indented Code Block Example
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Illustrates a common Markdown pattern where indented code follows a list item. This example highlights how indentation is measured relative to the list marker and the 'foo' text.
```markdown
1. foo
indented code
```
--------------------------------
### Markdown Inside HTML Block (Table Example)
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows how blank lines within an HTML table structure are handled.
```markdown
.
```
--------------------------------
### Ordered List as First Block in List Item
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates an ordered list starting within a list item, resulting in nested ordered and unordered lists.
```markdown
1. - 2. foo
```
```html
-
```
--------------------------------
### Invalid ordered list start number (10 digits)
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Ordered list start numbers exceeding nine digits are not parsed as list items and are rendered as plain text.
```markdown
1234567890. not ok
```
```html
1234567890. not ok
```
--------------------------------
### Fenced Code Block with Tilde Fences
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates the use of tilde (~) characters for fenced code blocks. This example shows how tildes can be used as opening and closing fences, preserving internal content.
```markdown
```````````````````````````````` example
~~~~~~
aaa
~~~ ~~
.
aaa
~~~ ~~
````````````````````````````````
```
--------------------------------
### HTML Block with Partial Tag Start
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows an HTML block where the opening tag is split across lines due to whitespace, demonstrating flexibility in tag parsing.
```markdown
.
tr
```
--------------------------------
### Nested Link (Not Allowed)
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Illustrates that links cannot contain other links. This example shows an invalid nesting attempt.
```markdown
[foo [bar](/uri)][ref]
[ref]: /uri
```
--------------------------------
### Markdown.pl Behavior with Hard-Wrapped Numerals
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Example of how Markdown.pl does not interpret hard-wrapped numerals in a paragraph as the start of a list, contrasting with CommonMark's behavior.
```markdown
The number of windows in my house is
14. The number of doors is 6.
```
--------------------------------
### Emphasis and Strong Emphasis Precedence
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows a Markdown example with nested emphasis and strong emphasis markers. This raises questions about the precedence rules for parsing these inline elements.
```markdown
*foo *bar* baz*
```
--------------------------------
### Commonmarker with Parse and Render Options
Source: https://github.com/gjtorikian/commonmarker/blob/main/README.md
Demonstrates how to pass parse and render options to Commonmarker. Ensure options are provided as a hash dictionary with symbol keys.
```ruby
Commonmarker.to_html('"Hi *there*"', options:{
parse: { smart: true },
render: { hardbreaks: false}
})
```
--------------------------------
### Invalid Autolink with Colon and No Scheme
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows an example that is not an autolink because it contains a colon but does not conform to the absolute URI scheme requirements.
```markdown
.
<m:abc>
```
--------------------------------
### Handle Raw HTML
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates how raw HTML is handled. Ensure proper escaping for PHP within HTML.
```html
foo
```
--------------------------------
### Table followed by Paragraph
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows that a table is terminated by an empty line, after which a new paragraph can begin. This example includes a table followed by a paragraph.
```markdown
| abc | def |
| --- | --- |
| bar | baz |
bar
bar
```
```html
bar
```
--------------------------------
### Syntax Highlighter with Custom Theme Path
Source: https://github.com/gjtorikian/commonmarker/blob/main/README.md
Load custom themes for the syntax highlighter by providing a path to a directory containing `.tmtheme` files.
```ruby
Commonmarker.to_html(code, plugins: { syntax_highlighter: { theme: "Monokai", path: "./themes" } })
```
--------------------------------
### Changing List Delimiters Starts a New List
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates how changing the list marker (e.g., from '-' to '+') initiates a new list in CommonMark, affecting the HTML output.
```markdown
- foo
- bar
+ baz
```
```html
```
--------------------------------
### Commonmarker with Extensions and Render Options
Source: https://github.com/gjtorikian/commonmarker/blob/main/README.md
Shows how to enable extensions like footnotes and description lists alongside render options. Extensions are toggled within the 'extension' key.
```ruby
Commonmarker.to_html('"Hi *there*"', options: {
extension: { footnotes: true, description_lists: true },
render: { hardbreaks: false }
})
```
--------------------------------
### Inline Link with Space in Unbracketed Destination
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
This example shows that spaces in a link destination are not allowed unless the destination is enclosed in pointy brackets. The output is rendered as plain text.
```markdown
[link](/my uri)
.
[link](/my uri)
```
--------------------------------
### Basic Image Syntax
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Standard image syntax with description, URL, and optional title.
```markdown

```
```html

```
--------------------------------
### List item with indented code block and specific start number
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
When an ordered list item starts with an indented code block, the indentation rules apply, and the start number is correctly parsed.
```markdown
10. foo
bar
```
```html
-
foo
bar
```
--------------------------------
### Link Label with Escaped Closing Bracket
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Shows an example where an escaped closing bracket is used within a link label, demonstrating proper escaping.
```markdown
[foo][ref\[]
```
--------------------------------
### HTML Block Starting with Closing Tag
Source: https://github.com/gjtorikian/commonmarker/blob/main/test/fixtures/upstream/spec.txt
Demonstrates an HTML block that begins with a closing tag '', followed by Markdown content, and then the end of the block.
```markdown