Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions corpus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ beginning-of-file position, or end-of-file position are significant remain
isolated under descriptive filenames. Markdown input remains free of embedded
expected HTML and parser-specific assertions.

A fixture identifies its own expected state, so that a heading covering several
cases never leaves the reader deriving which case is which. Where a construct
has room for content, that content names the outcome, as in
`*asterisk opens but underscore closes_`. Where the content is itself under
test, a label outside the construct names the case, as in
``Opening-only one: `code``. Where neither fits, such as thematic breaks,
escape runs, and exact-byte fixtures, a section holds one case so its heading
is unambiguous alone. Placeholder content such as `alpha`, `foo`, or `A` and
`B` is reserved for sections where every case shares one outcome. Naming an
outcome in prose is not the same as embedding expected HTML or a
parser-specific assertion, which stay out of Markdown input.

## Dialect Boundaries

- [`commonmark/`](./commonmark/) covers CommonMark 0.31.2 core syntax.
Expand Down Expand Up @@ -52,10 +64,10 @@ rules, links, images, autolinks, inline raw HTML, hard and soft breaks, and
textual content.

The [boundary fixtures](./boundaries/) preserve LF, CRLF, CR, mixed endings,
missing final newlines, a UTF-8 BOM, representative ASCII controls, tabs, an
empty document, and reference-label lengths. The [stress fixtures](./stress.md)
include 32- and 33-level link-destination nesting without treating either depth
as a CommonMark conformance cutoff.
missing final newlines, a UTF-8 BOM, representative ASCII controls, an invalid
UTF-8 byte, tabs, an empty document, reference-label lengths, and long lines.
The [stress fixtures](./stress.md) include 32- and 33-level link-destination
nesting without treating either depth as a CommonMark conformance cutoff.

Formal GFM fixtures cover [tables](./gfm/tables.md),
[task-list items](./gfm/task-lists.md), [strikethrough](./gfm/strikethrough.md),
Expand All @@ -67,8 +79,9 @@ The extension survey includes:
- [Footnotes](./extensions/footnotes.md)
- [YAML](./extensions/frontmatter/yaml.md),
[TOML](./extensions/frontmatter/toml.md), and
[JSON](./extensions/frontmatter/json.md) frontmatter, plus a
[not-at-start](./extensions/frontmatter/not-at-start.md) boundary
[JSON](./extensions/frontmatter/json.md) frontmatter, plus
[not-at-start](./extensions/frontmatter/not-at-start.md) and
[unclosed](./extensions/frontmatter/unclosed.md) boundaries
- [Dollar and LaTeX-style math](./extensions/math.md)
- [Inline, leaf, and container directives](./extensions/directives.md)
- [Definition lists](./extensions/definition-lists.md)
Expand All @@ -81,7 +94,6 @@ The extension survey includes:
- [Block and inline attributes](./extensions/attributes.md)
- [Highlight, subscript, superscript, insertion, and CriticMarkup-style deletion and addition](./extensions/typography.md)
- [Emoji shortcodes](./extensions/emoji.md)
- [Fenced diagrams](./extensions/fenced-diagrams.md)

## Practical Documents

Expand All @@ -90,5 +102,6 @@ The extension survey includes:
- [Extension survey](./practical/extension-survey.md)
- [Technical README](./practical/technical-readme.md)
- [Multilingual field notes](./practical/multilingual-notes.md)
- [Round-trip normalization walkthrough](./practical/round-trip.md)

![Corpus leaf](./assets/leaf.svg)
10 changes: 7 additions & 3 deletions corpus/boundaries/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Byte and Grammar Boundaries

The `bytes/` fixtures preserve exact byte sequences through attributes in the
repository's `.gitattributes`. The `limits/` fixtures exercise the normative
CommonMark reference-label length boundary as an adjacent 999/1000-character
pair.
repository's `.gitattributes`. `invalid-utf8.md` is deliberately not a valid
UTF-8 document; it must be opened through the application rather than repaired
by an editor that rewrites it on save.

The `limits/` fixtures exercise the normative CommonMark reference-label length
boundary as an adjacent 999/1000-character pair, and line lengths that a
viewport-wrapping prose surface has to accommodate.
1 change: 1 addition & 0 deletions corpus/boundaries/bytes/invalid-utf8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
before�after
15 changes: 15 additions & 0 deletions corpus/boundaries/limits/long-line.md

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions corpus/commonmark/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Block structure takes precedence over inline parsing

- `one
- two`
- `a code span does not
- cross a list-item boundary`

## Asterisks, hyphens, and underscores form thematic breaks

Expand Down Expand Up @@ -56,6 +56,11 @@ Paragraph becomes a heading

---

## An asterisk thematic break interrupts a paragraph instead

Paragraph followed by asterisks
***

## Definitions resolve full reference links

[garden]: /plots/garden "Garden title"
Expand All @@ -64,6 +69,13 @@ Paragraph becomes a heading

Open the [garden] and [field report].

## Forward-referenced and unreferenced definitions

Open the [forward reference] before its definition appears.

[forward reference]: /forward "Forward title"
[never referenced]: /unused "Unused title"

## Duplicate reference definitions

[same]: /first
Expand Down
10 changes: 8 additions & 2 deletions corpus/commonmark/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Four spaces create an indented code block

alpha
beta
four spaces open the block
two further spaces stay in the content

## Indented code cannot interrupt a paragraph

Expand Down Expand Up @@ -38,6 +38,12 @@ valid backtick info string
valid tilde info string
~~~

## A backtick in a backtick info string does not open a fence

``` language`with-backtick
the preceding line stays paragraph text rather than opening a code block
```

## Three leading spaces open a fence while four create indented code

```
Expand Down
32 changes: 17 additions & 15 deletions corpus/commonmark/emphasis.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,25 @@ ___underscores open a combination but asterisks close***

\*\*\*not combined emphasis and strong emphasis***

## Rule of three
## A three-delimiter run splits into nested strong and emphasis

***alpha** beta*
***strong closes first** and emphasis wraps both*

*alpha **beta***
*emphasis opens first **and strong closes first***

**alpha *beta***
**strong opens first *and emphasis closes first***

___alpha__ beta_
___strong closes first__ and emphasis wraps both_

_alpha __beta___
_emphasis opens first __and strong closes first___

__alpha _beta___
__strong opens first _and emphasis closes first___

## Unequal delimiter runs leave unused markers

***text*
***two markers stay literal*

***text**
***one marker stays literal**

## Matching delimiter characters can nest

Expand All @@ -118,14 +118,16 @@ __alpha _beta___

## Mixed asterisk and underscore runs

_**text*
_**underscore and one asterisk stay literal*

_**text**
_**underscore stays literal while strong pairs**

_**text**_
_**underscore and asterisks all pair**_

*__text_
## Mixed runs in intraword position

*__text__
foo*__nothing pairs intraword_baz

*__text__*
foo*__underscores stay literal intraword__baz

foo*__asterisks pair, underscores stay literal__*baz
71 changes: 71 additions & 0 deletions corpus/commonmark/html.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,73 @@
Markdown *inside* this block is raw.
</script>

## A blank line does not end a script or style block

<script>
const before = 1;

const after = 2;
</script>

<style>
.leaf { color: green; }

.bed { color: brown; }
</style>

## Comments form an HTML block

<!-- a multiline
comment -->

## A blank line does not end a comment block

<!-- a comment opens here

and closes after a blank line -->

## Block-level tags form an HTML block

<section class="garden">
*Markdown is raw until the blank line for this block type.*
</section>

## A blank line ends a block-level tag block before its closing tag

<section class="garden">
Raw content of the block.

*This paragraph follows the block rather than belonging to it.*

</section>

<details>
<summary>Collapsible summary</summary>

*This paragraph sits between two block-level tag blocks.*

</details>

## Block-level tags may interrupt a paragraph

Paragraph text before a known block tag.
<section class="garden">
Raw content after the interruption.
</section>

## A closing tag alone begins a block

</section>
Raw content following a closing tag that opened the block.

## Attributes may span lines, omit quotation, and use single quotes

<section
class=garden
data-bed='north'>
*Raw content of a start tag spread across several lines.*
</section>

## CDATA declarations form an HTML block

<![CDATA[
Expand All @@ -41,6 +97,11 @@ north bed declaration
*Raw until the blank line ends this type-seven block.*
</garden-card>

## Complete custom tags may not interrupt a paragraph

Paragraph text before a custom tag.
<garden-card data-bed="north">

## Tags may appear inside paragraph text

Text with <span class="leaf">raw *inline* HTML</span> after it.
Expand All @@ -51,6 +112,16 @@ An empty tag <br /> and a custom tag <garden-plot data-bed="north" /> remain raw

Text <!-- comment --> then <?garden inspect?> and <!GARDEN note> and <![CDATA[raw <leaf>]]>.

## Mismatched inline tags remain raw

Text with <em>an opening tag and a foreign </strong> closing tag.

## Event-handler attributes and script content remain literal text

<div onclick="alert(1)">A handler attribute stays part of the raw source.</div>

An inline <img src=x onerror=alert(1) /> and a <script>alert(1)</script> span.

## Malformed tag-like text remains literal

< a> <33> <__> <tag bad*name=value> </tag attribute=value>
16 changes: 16 additions & 0 deletions corpus/commonmark/links-and-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,24 @@

<foo.bar.baz>

<data:text/html,<script>alert(1)</script>>

<https://example.com

## Script-like and data schemes are ordinary destinations

<javascript:alert(1)>

<data:text/plain,alert>

[Inline script scheme](javascript:alert(1))

[Data destination](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==)

[Entity-obfuscated scheme](&#106;avascript&#58;alert&lpar;1&rpar;)

![Data image](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciLz4=)

## Inline and reference image forms

[leaf]: ../assets/leaf.svg "Leaf"
Expand Down
19 changes: 19 additions & 0 deletions corpus/commonmark/lists-and-blockquotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ lazy continuation without another marker
>
> Final quoted paragraph.

## Lazy continuation cannot begin a new block

> Quoted paragraph before a heading
# heading outside the quote

> Quoted paragraph before a list
- list item outside the quote

## Nested blockquotes and lists

> Outer quote
Expand Down Expand Up @@ -76,6 +84,17 @@ An ordered list beginning with two does not interrupt:
*
* third

## A list item can begin with a blank line

-
content on the line after the marker

## An empty list item cannot interrupt a paragraph

A paragraph that
-
continues instead of becoming a list.

## Marker-padding boundaries

- one space
Expand Down
7 changes: 7 additions & 0 deletions corpus/commonmark/text-and-breaks.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ This line follows the break.
Three spaces follow this line.
This line follows the second break.

## Trailing whitespace that does not create a hard break

One space follows this line.
This line continues the same paragraph.

Two spaces follow the end of this paragraph.

## Hard breaks using a backslash

A backslash follows this line.\
Expand Down
12 changes: 12 additions & 0 deletions corpus/environment/asset-handoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@
- ![Protocol-relative image](//example.com/image.png)
- ![Unsupported bitmap](../assets/unsupported.bmp)
- ![Outside icon](../../src-tauri/icons/128x128.png)

## Raw HTML embeds

<img src="../assets/leaf.svg" alt="Raw HTML image" />

<video src="./missing-clip.mp4" controls></video>

<audio src="./missing-tone.mp3" controls></audio>

<iframe src="./article-navigator/01-overview.md"></iframe>

<embed src="../../docs/specification.md" type="application/pdf" />
7 changes: 0 additions & 7 deletions corpus/extensions/fenced-diagrams.md

This file was deleted.

Loading