Examples: Edge Cases
These edge cases are executable conformance fixtures, organized into topical pages for easier reading.
Tables
Alignment, spans, multi-line cells, ragged rows and the pipe rules that decide whether a table exists at all.
- Table without alignment
- Table alignment with colspan
- Table doubled alignment marker
- Table columns carry alignment, vertical alignment and widths
- A table alignment run carries two independent axes
- A vertical table marker needs a horizontal partner
- A table cell can inherit horizontal alignment
- Pipe tables can state head and foot row counts
- Table cell escaped pipe
- Table cell pipe inside code span
- An unclosed verbatim run in a row stops at the closing pipe
- A continuation row's open run, and an escaped closing pipe
- An attributed cell keeps its attributes and its literal marker
- Table stacked rowspan
- Table rowspan with multi-line content
- Superscript in a table cell
- Table span marker in first column
- Table cell attributes
- Cell attributes bind after the kind and alignment markers
- A table cell's marker run ends at a space
- Table row attributes
- Table header cell rowspan
- Blocked span marker renders as empty cell
- Colspan marker scans left past a consumed cell
- A pipe pair with no cell is not a table
- A row whose every cell is blank is not a table
- A continuation row needs a body row
- Table row closing pipe
- A table delimiter cell needs at least one dash
- A continuation row carries no trailing text
- A ragged table keeps each row's cell count
- Tables
Lists
Markers, looseness, the content-column model, continuation markers and block openers inside items.
- An invisible fenced block is not a list paragraph
- Lists
- Ordered marker vs prose
- Parenthesized ordered marker
- List nesting and looseness
- List lazy continuation
- Compact list blocks
- Marker-line nested lists
- Fence opener with a nested-list body inside a list item
- Sublist marker interrupts a continuation paragraph
- Post-blank list continuation (content-column model)
- Nested item looseness does not propagate to the outer item
- Table as a block opener in a list item
- A paragraph opened after a block in an item is still open for a lazy line
- An unterminated container does not extend the item past a blank line
- A task item's checkbox is not decided by its first block
- Only lazy folding demotes a marker-line colon opener
- A blank line before a sibling marker separates the items, whatever consumed it
- A raw block keeps the blank line at the end of its payload too
- An unterminated fence at a content column opens no block, so the paragraph stays open
- A heading at an item's content column leaves no paragraph open
- A quote is reached by its marker, and a column never reaches into one
- A marker folds into a quote below it
- Colon-fence as a block opener in a list item
- Fence folds as lazy inline code above the content column
- Indented ordered marker content column includes the marker indent
- Outer item with an internal blank before an attached block is loose
- Tight list item keeps trailing text after a block bare
- Bare-dot ordered markers
- A definition attached by a + continuation marker is collected, and the item keeps no trace
- An uppercase roman numeral is a list marker
- Sibling markers that reach one column are one list
- The continuation marker at an item's own column, and what follows it
- A continuation marker after a blank line in the item
- A continuation marker attaches one block, and the boundary is that block's extent
- A continuation marker after a blank line in a loose item
- A fence opened on a list marker line, body below the content column
- A below-column marker after a comment, where no paragraph is open
- A column-zero definition ends an open list item
- A definition between two open content columns reaches the outer one
- Adjacent sibling lists survive the round trip
- A multi-letter ordered marker opens no list
- A block attached after an invisible line leaves the item tight
- A blank line loosens an item only when a paragraph follows it
- A resumed lazy run belongs to the innermost marker-line item
- A marker-line link definition is collected where no paragraph is open
- A lazy marker line's definition defines nothing, in any container
- A marker folds only strictly between the item's base and content column
- A continuation marker attaches only a flush-left block
- A longer run at a list boundary is written as exactly three blank lines
- One consumed boolean spells the looseness no blank line can
- The writer spells looseness only where a blank line cannot
- A floating attribute does not widen a list item's content column
- The continuation marker attaches one block in every container
- The continuation marker's column gate reaches every container
- An empty description body claims no line below column 0
- An empty description body is written with the empty sentinel
- A colon followed by only whitespace is not a description
- A leading continuation marker in a footnote body or a quote is text
Containers, quotes and fences
Divs, block quotes, code and comment fences: nesting, lazy continuation, absorption and what closes what.
- Fenced code shorter inner fence
- Blockquote caption after a blank line
- Opaque spans inside a container
- Blockquote lazy continuation
- Fenced code language with punctuation
- Blockquote lazy continuation stops at a fenced block
- Nested comment fences
- Indented colon-fence blocks stay literal
- Below-content-column div body in a list item stays literal
- Comment fence with trailing text
- Unterminated comment fence
- Widened verbatim fences
- A comment is recognized at any column
- A comment fence is a comment at any column too
- A comment under a nested item does not close it
- A definition inside a comment registers nothing
- A comment fence at an item's content column registers nothing either
- A footnote definition inside an item's comment registers nothing
- A comment fence opened on an item's marker line hides its body too
- A comment fence one item deeper registers nothing either
- A wider comment fence inside an item hides its body the same way
- An abbreviation inside a comment defines nothing
- A comment fence inside a colon container registers nothing
- A comment fence reached through a quote registers nothing either
- A blank after a comment still ends the item
- A comment fence under a nested item does not close it either
- A comment ends the paragraph it sits under
- A quote marker is
>plus a space, and a lazy line keeps its own text - A block-attribute line inside a quote ends the paragraph above it
- A floating attribute is scoped to the container that holds it
- A floating attribute under a definition attaches at column zero
- A comment fence at column 0 ends the item; a
%%line does not - Two backticks are not a code fence, opening or closing
- A single percent is not a comment
- A multi-line raw block is placed at its opening and verbatim after it
- An all-blank raw payload still emits its line
- A raw block passes its attributes through untouched
- An absorbed colon fence leaves a block quote's paragraph open
- A real div in a container and the flush-left line after it
- The flush-left line after a container a quoted line opened
- A column-0 line after a container's last block, when that block left no paragraph open
- A list marker at the content column inside an open fence
- A boundary line inside an open fence does not end the container
- A container a lazy line folded into is still open
- A fence keeps the blank line at the end of its content
- A captioned quote holds more than one block
- Composite figures
- Fenced code
- Admonitions
- Comments
- An unclosed inline run in a line block reaches the end of the block
- A comment-only line in a line block is removed before any inline run
- A terminal comment in a quote leaves no paragraph open
- A terminal comment line still leaves an empty verse line
- A line block's hard break keeps its backslash
- A line block's last body line keeps its backslash
- A closed inline construct spanning a verse boundary
- A container whose table ends on a continuation row
- A definition at a container's content column
- A bracketed construct spanning a line boundary
- A bracketed construct's identifiers stay on one line
- A bracketed construct spanning a verse boundary
- A continuation row joins the row above it, whatever its cells hold
- A container whose table ends on a joined header row
- A quote inside a quote is asked what it ends on
- A block at a container's content column ends the paragraph, whatever it renders
- What a content-column block does not reach
- A footnote definition's block runs to the end of its body
- A collected definition closes the item paragraph
- A container's span ends at its last placed child
- A definition list ends at its last placed child too
- A marker at an item content column opens a sublist, first in the item or not
- A container starts at its opening markup even where its first child is unplaced
- A container ends at the markup that closes it even where its last child is unplaced
- A definition behind an alternating container prefix registers at the innermost content column
- Line blocks
- Inline code
- Generic divs
- An unclosed bare colon fence opens a div
- A fenced block quote is the block quote written another way
- An unterminated comment fence in a list item is the line form
- A degraded comment fence at a container's column 0 keeps the follower in the item
- A degraded comment fence leaves a lazy follower where the line form does
Paragraphs, breaks and captions
Paragraph folding, thematic breaks, caption attachment and adjacent block openers.
- Blocks that render to nothing
- Paragraph interruption
- Thematic break requires contiguous markers
- A flush-left line needs an open paragraph to fold into
- Two dashes are not a thematic break
- A caption attaches across one blank line
- Two blank lines detach a caption
- Adjacent block openers in an attached run stay separate
- A caret line does not end a paragraph it cannot caption
- A caption's marker separator is a run, and none of it is content
- A quote holding a captioned block indents it like any other nested block
- A heading's marker separator is a run, and none of it is content
Inline spans
Emphasis flanking, mentions and tags, smart typography, inline literals and escaping.
- Mention ignores email addresses
- Tag requires a word boundary
- Smart typography escapes and code
- The doubled run is the canonical arrow, in both families
- Empty delimiters
- Escape coverage
- Emphasis edge cases
- Doubled emphasis delimiters
- Two-char delimiter runs
- Mention and tag name boundaries
- Strong emphasis starting with a link
- Literal less-than in prose
- Editorial markup takes a trailing attribute
- Emphasis opener slash-adjacency
- Bold-italic delimiter needs content
- Emphasis span closes before a following delimiter
- Unclaimed openers stay literal
- Inline literal
- All-space verbatim content
- Adjacent slash and underscore emphasis nest
- Quote flanking after an escaped character
- A combined bold-italic span may cross a line
- A tag inside a literal brace run is still a tag
- A math span's base class keeps the class slot in place
- A marker glued to a name opens nothing
- An angle bracket is escaped only where it opens markup
- An escaped hash keeps its escape at a container's content position
- An unclosed inline literal reaches the end of its block
- A hyphen run opening a word after whitespace is a flag
- A braced hyphen pair is an en dash
- An empty brace pair is not a construct
- A leading escaped caret keeps its escape
- An idle escape does not spread from the block that needed one
- An idle escape does not spread from the occurrence that needed one
- A boolean attribute does not start with an underscore
- Emphasis
- Inline extensions
- Smart typography dashes and quotes
- Inline code
- Non-breaking space
- Superscript and subscript
- Symbols
Links, images and references
Destinations, titles, reference and collapsed forms, autolinks and where a definition may live.
- Nested brackets in link text
- An image's alt text closes where a link's text closes
- An editorial comment's bracket is content, not the close
- Reference labels are case-sensitive
- Link destination parentheses balance
- Empty link and image titles are preserved
- A backslash in a link destination is a literal character
- Autolink display keeps the raw content
- Link reference definition separator must be a space
- A reference definition cannot take its destination from the next line
- Indented image and caption stay literal
- A lone indented image is a paragraph, and its HTML cannot say so
- A lone reference image at column 0, in every spelling
- An item's attribute block moves its content column; its checkbox does not
- Indented reference and footnote definitions stay literal
- A repeated definition: which one wins
- A collapsed reference is matched by the label the author wrote
- A definition inside a container is collected at that container's content column
- Trailing attributes on a link reference definition
- An image takes a reference the way a link does
- A collapsed image reference uses its alt text as the label
- One definition serves a link and an image
- An unresolved image reference stays literal
- A reference image takes a caption
- An unresolved reference image takes no caption
- An unresolved image gives its whole caption slot back, at any depth
- An at sign is a reference label character everywhere but the first position
- A label beginning with an at sign is not a reference label
- A link definition written before a footnote stays before it
- A zero-width character in a reference definition destination
- A block image is separated from the block after it on every target
- A reference definition is anchored at end of line
- An autolink body admits non-ASCII and excludes format characters
- Unresolved reference link
- Bare URLs stay literal
- Links
- Reference link
- Autolinks
Footnotes
Bodies as blocks, the body content column, collection inside containers and placement of the rendered list.
- Footnote with multiple blocks
- Cross-references resolve inside footnote bodies
- Footnote definition inside a container is collected
- Footnotes placement
- Footnote definition requires an inline body
- Footnote definition separator must be a space
- Unresolved footnote reference with a trailing attribute stays literal
- A caret is a reference label, not an empty footnote
- A definition on a footnote body's continuation line is collected
- A footnote body holds blocks, and they render where they were written
- A heading in a footnote body takes an id but no section wrapper
- An attribute line inside a footnote body attaches inside it
- A nested list in a footnote body stays nested
- A flush-left line after a footnote definition belongs to the document
- A footnote continuation survives a blank run
- A footnote body's authored base can open a table past column two
- A definition below a footnote body's column is the document's own text
- A definition past a footnote body's column registers from its authored base
- A tab reaches a footnote body's column just as two spaces do
- A footnote body's last block, when it is not a paragraph, gets a synthesized paragraph for the backlink
- A line at a footnote definition's own column, followed by non-blank text, forms its own tight block
- An empty footnote body is written with the
{empty}sentinel - An empty inline note is literal
- A note's content recognizes no note
- A footnote in link text nests the anchors
- A footnote in reference link text nests the anchors too
- A note body's own references resolve
- A reference link's text survives its own frame
- An authored base carries opaque payload, captions, and nested metadata
- A footnote in an unresolved reference is not a reference
- An inline note's content resolves after the note
- Footnotes
- A definition list inside a footnote body carries its authored base
- A recognized opener in a body needs no blank line above it
- One authored base rule reaches a definition nested in a list item
- A comment in a footnote body is invisible in both spellings
Definition lists and abbreviations
Terms and descriptions, abbreviation definitions and the document levels that may declare them.
- Abbreviation matches on word boundaries only
- Abbreviation definition interrupts a paragraph
- Abbreviation definition separator must be a space
- Definition list as a first-class block opener
- Abbreviation title escapes its markup characters
- Under-indented definition attaches, over-indented definition folds
- Wrapped definition term continuation below the content column strips leading whitespace
- Two abbreviation definitions
- An abbreviation definition is recognized only at document level
- A list item does not define an abbreviation either
- A div does not define an abbreviation either
- A definition below every content column folds as text
- An abbreviation at a list item's content column is still not a definition
- An abbreviation definition in an item body is paragraph text
- A
:description line needs a term above it - A tab as the first character of a definition term
- An abbreviation term is one ASCII alphanumeric word
- A definition inside a definition-list dd is collected, and the entry keeps no trace
- An empty abbreviation term is not a definition
- A definition body opener at or past its column stays structural
- An abbreviation expands inside an inline container
- Definition lists
- One consumed boolean spells the looseness no blank line can
- A definition body's separator width sets its content column
- An ordered item's separator width sets its content column
- Below a definition body's column the body ends
- An opener at or past a description body's column closes its paragraph
- The host does not change which column a definition reaches
- Below a definition body's column an invisible line folds as text
- A comment below a description body's column ends the body
- A closed fence in a description body ends it
- A container in a host body owns a line past its own content column
- A block opener past a nested footnote definition opens in the item
- An unterminated fence on a nested lead in a description body owns its body
- A definition nested past a footnote body is a note, and a reference below it resolves
- A container closer closes its container in a footnote body too
- A wrapped attribute block ends at its quote and reaches no line below it
- A trailing line after a consumed definition is placed by column-reach
- A nested note's floor is two columns past its own marker
- A column-0 line after a description-hosted note is a document sibling
- An empty unterminated container ends at a flush-left line
- An abbreviation definition outside document level is not an invisible line
Attributes
Attribute lines and inline blocks, names and values, classes, booleans and the semantic/language sugar.
- Attribute edge cases
- Trailing attribute block edge cases
- Block attribute lines
- Boolean attributes
- Unquoted attribute values may contain dots and colons
- Adjacent attribute blocks on one line merge
- Classes are deduplicated
- Code span and image trailing attributes are strict
- A bare attribute block on its own line is literal
- Leading attribute brace before an inline span stays literal
- Attribute block after a mention stays literal
- Image trailing attribute is strict about the glue
- Indented attribute line stays literal
- Attribute braces on a list-item marker line
- A floating attribute stops at the item boundary
- A marker attribute may hold a quoted brace
- An attribute name admits no colon
- An inline attribute block does not span lines, but an attribute line does
- The inline attribute interior is space-only, the attribute line is not
- A quoted attribute value stops at the newline
- A structural attribute leads the author's own
- A boolean and a key/value of the same name are one attribute
- A semantic name renames the span, and the leftovers ride the element
- A language attribute is exact sugar for lang
- A malformed language tag leaves the whole block literal
- A language attribute and lang are one key
- The language sigil takes no padding
- A boolean lang is the third spelling of the same key
- The semantic registry holds no element Carve already spells
- Two attributes need a separator between them
- A derived title yields to an authored one
- An attribute block reaches the nested list it precedes
- An attribute line after a continuation marker attributes the attached block
- Attributes
- Inline span
- An attribute line below a list item interrupts it
- A wrapped attribute line leaves no paragraph open
- An engine-written shape says what it is called
- Text-block alignment renders the CSS declaration
- A sigil fence takes its attribute line
Headings and cross-references
Section wrapping, id derivation and normalization, implicit and collapsed heading references.
- Single-line headings
- Heading marker column zero
- Cyclic cross-reference resolves to one level
- Only the id hoists to the section wrapper
- Headings inside containers are not wrapped
- Attribute order on an unwrapped heading
- Implicit heading references with no definition
- A heading id keeps a non-ASCII space
- A heading reference folds Unicode normalization, but not compatibility
- A collapsed reference reaches a heading by the heading's rendered text
- Heading-index plain text covers visible leaves and rejects an empty key
- Which inline content a heading id is derived from
- Headings
- Numbered cross-references
- Heading IDs
Whitespace, tabs and columns
Where a space is required, where a tab reaches, blank lines, line endings and trailing whitespace.
- Paragraph trailing whitespace
- Trailing whitespace boundaries
- A marker separator is a space, never a tab
- An invisible line does not cancel a blank-line separation
- An invisible line before the blank does not cancel the separation
- A tab after a heading, quote or caption marker leaves the line as prose
- A tab indent is the column it reaches, whatever the line holds
- The same column, written with four spaces
- Trailing whitespace after a block marker
- Line endings and a byte order mark
- A null byte is replaced before the document is read
- A tab separates two attributes, and pads a block, as a space does
- Colon fence separator must be a space
- Colon fence metadata slots must be a space too
- Table cell padding must be a space
- Link and image title slots must be a space
- Code fence metadata slots must be a space too
- A tab continues a list item just as two spaces do
- A blank line holds spaces and tabs and nothing else
- A link title takes exactly one space
- A code fence opener takes exactly one space
- The canonical writer glues a code fence to its info string
- A frontmatter opener takes exactly one space
- A reference definition's metadata slots take exactly one space
- A definition marker's separator is a space, and it is a run
- Trailing whitespace on a content line is dropped
- A tab after a fence or a frontmatter opener depends on where it sits
- Fenced code
- Reference link
- Comments
- Line blocks
Security and limits
Trojan-Source stripping, scheme probes, attribute hardening and the nesting cap.
- Security hardening
- Trojan-Source: heading ids are NFC-normalized and strip invisible controls
- Trojan-Source: rendered text and code strip bidi-override controls
- Scheme probe strips Unicode whitespace
- URL-list attributes are probed token-wise
- Openers past the nesting cap are one paragraph
- A format character before a scheme is not stripped, and is inert
- Include directive with no resolver renders literal
- Inline extensions
- Autolinks