an opening tag and a foreign closing tag.
+
+## Event-handler attributes and script content remain literal text
+
+A handler attribute stays part of the raw source.
+
+An inline
and a span.
+
## Malformed tag-like text remains literal
< a> <33> <__>
diff --git a/corpus/commonmark/links-and-images.md b/corpus/commonmark/links-and-images.md
index 8eda425..f0e64e9 100644
--- a/corpus/commonmark/links-and-images.md
+++ b/corpus/commonmark/links-and-images.md
@@ -32,8 +32,24 @@
+alert(1)>
+
+
+
+
+[Inline script scheme](javascript:alert(1))
+
+[Data destination](data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==)
+
+[Entity-obfuscated scheme](javascript:alert(1))
+
+
+
## Inline and reference image forms
[leaf]: ../assets/leaf.svg "Leaf"
diff --git a/corpus/commonmark/lists-and-blockquotes.md b/corpus/commonmark/lists-and-blockquotes.md
index f7c555e..e27c623 100644
--- a/corpus/commonmark/lists-and-blockquotes.md
+++ b/corpus/commonmark/lists-and-blockquotes.md
@@ -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
@@ -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
diff --git a/corpus/commonmark/text-and-breaks.md b/corpus/commonmark/text-and-breaks.md
index eca6143..f7e5386 100644
--- a/corpus/commonmark/text-and-breaks.md
+++ b/corpus/commonmark/text-and-breaks.md
@@ -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.\
diff --git a/corpus/environment/asset-handoff.md b/corpus/environment/asset-handoff.md
index ff21552..234f3c8 100644
--- a/corpus/environment/asset-handoff.md
+++ b/corpus/environment/asset-handoff.md
@@ -24,3 +24,15 @@
- 
- 
- 
+
+## Raw HTML embeds
+
+
+
+
+
+
+
+
+
+
diff --git a/corpus/extensions/fenced-diagrams.md b/corpus/extensions/fenced-diagrams.md
deleted file mode 100644
index 1dcc497..0000000
--- a/corpus/extensions/fenced-diagrams.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Mermaid Fenced Diagram
-
-```mermaid
-graph TD
- A[Read sensor] --> B[Compare gauge]
- B --> C[Plan watering]
-```
diff --git a/corpus/extensions/frontmatter/unclosed.md b/corpus/extensions/frontmatter/unclosed.md
new file mode 100644
index 0000000..89b441b
--- /dev/null
+++ b/corpus/extensions/frontmatter/unclosed.md
@@ -0,0 +1,10 @@
+---
+title: Unclosed frontmatter candidate
+tags:
+ - markdown
+ - corpus
+
+# Body After an Unclosed Delimiter
+
+The opening delimiter is never closed, so the boundary between the frontmatter
+candidate and the document body is ambiguous.
diff --git a/corpus/gfm/autolinks.md b/corpus/gfm/autolinks.md
index 4f78903..5089355 100644
--- a/corpus/gfm/autolinks.md
+++ b/corpus/gfm/autolinks.md
@@ -16,9 +16,15 @@ testing@example.com and first.last+tag@example.co.uk
## Left-context punctuation controls recognition
-(www.example.com) *https://example.com* _www.example.org_ ~www.example.net~
+Parenthesis before the link: (www.example.com)
-prefixwww.example.com
+Asterisk before the link: *https://example.com*
+
+Underscore before the link: _www.example.org_
+
+Tilde before the link: ~www.example.net~
+
+Word character before the link: prefixwww.example.com
## Trailing punctuation is excluded from the link
diff --git a/corpus/gfm/tables.md b/corpus/gfm/tables.md
index 77bca16..434359a 100644
--- a/corpus/gfm/tables.md
+++ b/corpus/gfm/tables.md
@@ -31,9 +31,35 @@ South | 42% | Hold
## Header and delimiter cell counts must match
-| A | B |
+| Header | Cells |
| --- |
-| one | two |
+| the count mismatch prevents a table | so these lines stay paragraph text |
+
+## A header and delimiter row without body rows
+
+| Header only | No body rows |
+| --- | --- |
+
+## Pipe rows without a delimiter row
+
+| No delimiter row | so these lines |
+| stay paragraph text | with literal pipes |
+
+## Cell splitting precedes inline parsing
+
+| Form | First cell | Second cell |
+| --- | --- | --- |
+| an unescaped pipe splits first | `code opens | never closes` |
+
+## Tables can appear inside containers
+
+- | Bed | Moisture |
+ | --- | --- |
+ | North | 31% |
+
+> | Bed | Moisture |
+> | --- | --- |
+> | South | 42% |
## Another block construct terminates the table
diff --git a/corpus/interactions.md b/corpus/interactions.md
index a42a290..145923f 100644
--- a/corpus/interactions.md
+++ b/corpus/interactions.md
@@ -2,7 +2,7 @@
## Links, emphasis, code spans, and autolinks
-*[a link*](destination.md) and [a backtick (`)](destination.md).
+*[the link wins over the emphasis run*](destination.md) and [a backtick (`)](destination.md).
`[not a link](destination.md)` and .
@@ -35,9 +35,9 @@ Code: `\*asterisks\* ©`.
> fenced code inside the list
> ```
>
-> [reference]: destination.md
+> [quoted leaf]: destination.md
>
-> Use the [reference].
+> Use the [quoted leaf].
## Table cells can contain inline constructs
diff --git a/corpus/isolated/end-of-file/unclosed-html-block.md b/corpus/isolated/end-of-file/unclosed-html-block.md
new file mode 100644
index 0000000..7135a72
--- /dev/null
+++ b/corpus/isolated/end-of-file/unclosed-html-block.md
@@ -0,0 +1,4 @@
+# Unclosed HTML Block at End of File
+
+
+The block reaches the end of the file without a closing tag or a blank line.
diff --git a/corpus/practical/round-trip.md b/corpus/practical/round-trip.md
new file mode 100644
index 0000000..add17a6
--- /dev/null
+++ b/corpus/practical/round-trip.md
@@ -0,0 +1,82 @@
+Field Notes That Change Shape When Saved
+========================================
+
+Every section below is written in a form the editor is expected to normalize.
+Save the document, reopen it, and compare each section against this description.
+A difference named here is intended; a difference that is not named here is not.
+
+Setext Underlines
+-----------------
+
+The title above and this heading use Setext underlines. Both carry heading
+levels that ATX syntax can also express.
+
+## Emphasis delimiter characters
+
+The _watering schedule_ and the __replacement estimate__ use underscore
+delimiters, while the *manual gauge* and the **north bed** use asterisks. Both
+pairs carry the same emphasis and strong emphasis.
+
+## Bullet and ordered markers
+
++ Spare battery
++ Probe cloth
+
+* Printed layout
+* Camera checklist
+
+3. Reposition the north-bed probe.
+8. Publish the calibration note.
+9. Review the battery estimate.
+
+## Indented code
+
+The collection step is recorded as an indented block:
+
+ pnpm run collect -- --bed north
+ pnpm run report
+
+## Inline-code delimiter length
+
+The command ``pnpm run collect`` uses a two-backtick run around content that
+needs only one.
+
+## Reference links against inline links
+
+The [calibration review][review] and the
+[placement decision](../environment/article-navigator/nested/probe-placement.markdown)
+point at comparable notes through different link forms.
+
+[review]: ../environment/article-navigator/01-overview.md "Calibration review"
+
+## Table cell padding
+
+| Bed | Latest reading | Working interpretation |
+| :-------- | -------------: | --------------------------- |
+| North | `31%` | Reposition before rewatering |
+| South | `42%` | Hold the current plan |
+
+## Hard break spelling
+
+The gauge was read at 08:30.
+The probe was reseated at 08:45.\
+The second reading followed at 09:00.
+
+## Selections without a faithful semantic equivalent
+
+Select only the delimiters of **this strong run**, only the destination inside
+[this link](../environment/article-navigator/01-overview.md), only the title in
+[this titled link](../environment/article-navigator/01-overview.md "Calibration review"),
+and only part of this footnote reference[^partial]. Copy each selection and
+paste it into a new paragraph.
+
+[^partial]: The reference above is selected partially on purpose.
+
+## Blank lines and final newline
+
+There are three blank lines after this paragraph and the file ends without a
+trailing blank run.
+
+
+
+The last line of the document.
diff --git a/corpus/stress.md b/corpus/stress.md
index 255d99b..64218bb 100644
--- a/corpus/stress.md
+++ b/corpus/stress.md
@@ -42,8 +42,6 @@ ____________beta____________
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ¡¿«»—…、。〈〉《》「」『』【】
-\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~
-
## Link destination nested to 32 levels
[depth](((((((((((((((((((((((((((((((((leaf)))))))))))))))))))))))))))))))))