Inline spans
Emphasis flanking, mentions and tags, smart typography, inline literals and escaping.
Generated from resources/examples/edge-cases/, resources/examples/core.md and resources/examples/extensions.md - edit the cases there, not here. Each case links the conformance fixture it produces.
An at sign before a space and a doubled delimiter inside bold italic are text
2 conformance fixtures
An @ not followed by a word character is ordinary text. A doubled delimiter run inside bold italic stays literal.
a @ b<p>a @ b</p>/*a // b*/<p><strong><em>a // b</em></strong></p>Mention ignores email addresses
1 conformance fixture
@ starts a mention only at a word boundary, so an email address is left untouched.
Write me@example.com or ping @markus.<p>Write me@example.com or ping <span class="mention"><strong>@markus</strong></span>.</p>Tag requires a word boundary
2 conformance fixtures
# starts a tag only at a word boundary; foo#bar is literal text.
A #tag here, but not in foo#bar.<p>A <span class="tag"><strong>#tag</strong></span> here, but not in foo#bar.</p>A tag name needs at least one ASCII letter (carve#4809), so #123 stays literal text while #v2 is a tag. The letter may stand anywhere in the name.
Issue #123 and #v2 here.<p>Issue #123 and <span class="tag"><strong>#v2</strong></span> here.</p>Smart typography escapes and code
1 conformance fixture
A backslash keeps the literal sequence; code spans and blocks are never transformed.
Escaped \-> and \... stay; code `a -- b ...` stays.<p>Escaped -> and ... stay; code <code>a -- b ...</code> stays.</p>The doubled run is the canonical arrow, in both families
1 conformance fixture
The single-line family was complete and the double-line family was not: ->, <- and <-> all existed, => existed, and there was no <= arrow, because <= is the comparison. So <=> rendered ≤>.
<= keeps ≤, which forces the left double arrow to grow a character, and once it does the family is spelled at one width throughout. The single-hyphen forms were deprecated first and are now removed (carve#4815), so <-, -> and <-> stay text. => was removed outright: key => value and Some(x) => x are ordinary prose about code, and every one of them silently became ⇒.
Canonical: <-- --> <--> and <== ==> <=>
Removed, now text: <- -> <->
Not an arrow: key => value stays literal, and p <= q is a comparison.<p>Canonical: ← → ↔ and ⇐ ⇒ ⇔</p>
<p>Removed, now text: <- -> <-></p>
<p>Not an arrow: key => value stays literal, and p ≤ q is a comparison.</p>The equals of a comparison neither opens nor closes a highlight
3 conformance fixtures
The = of <= and >= is part of the comparison (PART 9 §9, carve#4131): a bare highlight around one keeps the glyph inside, and a comparison alone opens or closes nothing. An arrow such as <== keeps its own rule.
=a <= b=
=a >= b=<p><mark>a ≤ b</mark>
<mark>a ≥ b</mark></p>=a>= b<p>=a≥ b</p>=a <= b= and =c=<p><mark>a ≤ b</mark> and <mark>c</mark></p>Empty delimiters
1 conformance fixture
A delimiter pair with no content is literal text, not emphasis.
** and // and ^^<p>** and // and ^^</p>Escape coverage
2 conformance fixtures
A backslash escapes any ASCII punctuation character to its literal form. This pins the full ascii_punctuation matrix (&, :, ;, ? included); <, >, & are then HTML-escaped in the output.
\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ done<p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ done</p>A backslash before a non-ASCII character or a letter is literal; \\ is a single backslash.
\a and \« and a\\b<p>\a and \« and a\b</p>Escaped space in inline text
1 conformance fixture
A backslash before a space creates a no-break space.
a\ b<p>a b</p>Emphasis edge cases
4 conformance fixtures
Two emphasis spans of the same kind sit side by side without merging.
*a* and *b*<p><strong>a</strong> and <strong>b</strong></p>A code span inside emphasis is preserved.
*a `x` b*<p><strong>a <code>x</code> b</strong></p>Different-kind delimiters sit adjacent without interfering.
~old~ =new=<p><s>old</s> <mark>new</mark></p>Trailing punctuation after a closer is literal.
*a, b*!<p><strong>a, b</strong>!</p>Doubled emphasis delimiters
1 conformance fixture
A bare single-character emphasis delimiter immediately adjacent to the same delimiter does not open a span, so a doubled delimiter is literal text. This "no nesting of same type" rule is uniform across all seven single-character delimiters: **, ~~, ^^, ==, and ,, stay literal exactly like // and __.
**a** ~~b~~ ^^c^^<p>**a** ~~b~~ ^^c^^</p>Two-char delimiter runs
1 conformance fixture
Every bare delimiter is single-char. A doubled (or longer) run of any delimiter is literal by the same-delimiter-adjacency rule, so ==x== and ~~y~~ are doubled = / ~ and render literal, while the single-char =z= and ~w~ mark.
==x== ~~y~~ =z= ~w~<p>==x== ~~y~~ <mark>z</mark> <s>w</s></p>Mention and tag name boundaries
1 conformance fixture
A mention or tag name runs over letters, digits, _, -, and interior dots (a dot followed by another name character, as in @john.doe or #release-1.0). A dot at the end of the run is sentence punctuation, not part of the name; other punctuation ends the name and stays literal (an apostrophe becomes a typographic quote).
Ping @john-doe, @john_doe and @john.doe about #release-1.0 today.
Reach @john. That is @john's idea, @john!<p>Ping <span class="mention"><strong>@john-doe</strong></span>, <span class="mention"><strong>@john_doe</strong></span> and <span class="mention"><strong>@john.doe</strong></span> about <span class="tag"><strong>#release-1.0</strong></span> today.</p>
<p>Reach <span class="mention"><strong>@john</strong></span>. That is <span class="mention"><strong>@john</strong></span>’s idea, <span class="mention"><strong>@john</strong></span>!</p>Strong emphasis starting with a link
1 conformance fixture
A *[ at an emphasis-opening position is a bold span whose content begins with a link - only a line-start *[ followed by term]: is an abbreviation definition.
See *[the docs](url) for more* info.<p>See <strong><a href="url">the docs</a> for more</strong> info.</p>Literal less-than in prose
1 conformance fixture
A < that is neither an autolink, a crossref, nor a smart-typography arrow stays literal text (HTML-escaped on output).
Check if (x < 5) holds, and 3<4 too.<p>Check if (x < 5) holds, and 3<4 too.</p>Editorial markup takes a trailing attribute
1 conformance fixture
An addition {+...+} or deletion {-...-} is an ordinary inline node, so a trailing {...} attribute block attaches to its <ins> / <del>, exactly like a span, code span, link, or emphasis (PART 9 §22 / §15). The markers are single-character: the doubled form {++a++} is not special — the outer + are the delimiters and +a+ is literal content, so it yields <ins>+a+</ins> (as the example below shows).
{++a++}{.a}<p><ins class="a">+a+</ins></p>A line comment hides a substitution arrow
9 conformance fixtures
879-a-line-comment-hides-a-substitution-arrow879-a-line-comment-hides-a-substitution-arrow-2879-a-line-comment-hides-a-substitution-arrow-3879-a-line-comment-hides-a-substitution-arrow-4879-a-line-comment-hides-a-substitution-arrow-5879-a-line-comment-hides-a-substitution-arrow-6879-a-line-comment-hides-a-substitution-arrow-7879-a-line-comment-hides-a-substitution-arrow-8879-a-line-comment-hides-a-substitution-arrow-9
The first raw ~} ends a line comment in a {~ frame. An arrow in the comment cannot split the frame.
{~a %% b~>c~} d<p>{~a d</p>{~alpha %% hidden~>word~} tail<p>{~alpha tail</p>An arrow before the comment still splits the substitution.
{~a~>b %% c~} d<p><del>a</del><ins>b</ins> d</p>Inline frames start content and literals close quotes.
x{+"q"+}<p>x<ins>“q”</ins></p>2{+--x+}<p>2<ins>--x</ins></p>x:foo["q"]<p>x<span class="ext-foo">“q”</span></p>!`(`"q"<p>(”q”</p>`(`{=html}"q"<p>(”q”</p>A comment stops at the newline when no raw frame closer has appeared. The later arrow still splits the substitution.
{~a %% b~>c
~>d~}<p><del>a
</del><ins>d</ins></p>Emphasis opener slash-adjacency
4 conformance fixtures
A / immediately before a bare delimiter suppresses an italic / or underline _ opener there: / never opens after / (same-delimiter adjacency) and _ never opens after / (the extra cross-delimiter guard, path protection). So the underscore in a_/_a_ stays literal.
a_/_a_<p>a_/_a_</p>An underline opener directly after a slash is literal on its own, too.
a/_y_<p>a/_y_</p>A path-like /a/ opens italic; the following _b_ does not open, because its opening _ sits immediately after the closing /.
/a/_b_<p><em>a</em>_b_</p>The guard is specific to / and _: the other delimiters *, ~, = DO open after a /, so a preceding slash does not suppress them.
a/~y~ a/=y=<p>a/<s>y</s> a/<mark>y</mark></p>Bold-italic delimiter needs content
4 conformance fixtures
A bold-italic run /*...*/ collapses to <strong><em>...</em></strong> only when it wraps content. With nothing between the delimiters, the inner ** is literal and only the outer /.../ italic applies -- so /**/ is an emphasized **, not empty bold-italic.
/**/<p><em>**</em></p>A single space is content for the outer italic but not for the bold pair, so the * * stays literal inside one <em>.
/* */<p><em>* *</em></p>With real content, the full bold-italic collapse still applies.
/*x*/<p><strong><em>x</em></strong></p>The outer / of the pair takes the same word-boundary guards as a bare /: it does not open after a letter or digit and does not close before one. Once the combined token fails, each delimiter is read on its own, so the slashes stay text and the inner * pair still makes a bold span.
a/*y*/b<p>a/<strong>y</strong>/b</p>A run of asterisks inside a combined token is content
2 conformance fixtures
/*...*/ takes the run's first * as content and the last two characters as the closer, so a three-asterisk run is a combined span over one literal *. The two-asterisk /**/ of Bold-italic delimiter needs content is the neighbour where there is nothing left for content, and it stays an emphasized ** (markup-carve/carve#2135).
/***/<p><strong><em>*</em></strong></p>/****/<p><strong><em>**</em></strong></p>Any character is content of the combined bold-italic token
7 conformance fixtures
486-any-character-is-content-of-the-combined-bold-italic-token486-any-character-is-content-of-the-combined-bold-italic-token-2486-any-character-is-content-of-the-combined-bold-italic-token-3486-any-character-is-content-of-the-combined-bold-italic-token-4486-any-character-is-content-of-the-combined-bold-italic-token-5486-any-character-is-content-of-the-combined-bold-italic-token-6486-any-character-is-content-of-the-combined-bold-italic-token-7
bi_content is the content every other emphasis kind has, so a tab, a character outside the grammar's named classes, an escaped space, a hard break or a braced comment inside /*...*/ leaves the combined token whole (markup-carve/carve#2159). The first document holds a tab between the letters.
/*a b*/ y<p><strong><em>a b</em></strong> y</p>Characters no other content rule names.
/*a<b*/ y
/*a # b*/ y
/*a{b}c*/ y
/*a€b*/ y
/*a b*/ y<p><strong><em>a<b</em></strong> y</p>
<p><strong><em>a # b</em></strong> y</p>
<p><strong><em>a{b}c</em></strong> y</p>
<p><strong><em>a€b</em></strong> y</p>
<p><strong><em>a b</em></strong> y</p>An escaped space is a no-break space.
/*a\ b*/ y<p><strong><em>a b</em></strong> y</p>A backslash at the end of a line is a hard break.
/*a\
b*/ y<p><strong><em>a<br>
b</em></strong> y</p>A braced comment renders nothing.
/*a{%c%}b*/ y<p><strong><em>ab</em></strong> y</p>CONTROL. A tab before the closer is refused like a space, so the token falls through to an italic around literal asterisks. The third character is a tab.
/*a */ y<p><em>*a *</em> y</p>A %% comment runs to the end of its line, and the token closes on the next.
/*a %%c
b*/ y<p><strong><em>a
b</em></strong> y</p>A form feed or a no-break space is content wherever whitespace is tested
12 conformance fixtures
487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-2487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-3487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-4487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-5487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-6487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-7487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-8487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-9487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-10487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-11487-a-form-feed-or-a-no-break-space-is-content-wherever-whitespace-is-tested-12
Carve's whitespace is four characters: U+0020, U+0009, U+000A and U+000D (CARVE-P7-003). A form feed, a vertical tab, a no-break space and the other Unicode spaces are content in every construct, including the ones that only test for whitespace (markup-carve/carve#2157). In the documents below the invisible character is a form feed unless the text says otherwise.
A form feed after an opener or before a closer does not refuse the delimiter.
a /x/ b
a /x/ b<p>a <em>x</em> b</p>
<p>a <em>x</em> b</p>A code span holding a form feed between two spaces drops the spaces.
` `<p><code></code></p>A form feed after the closing pipe is content after the row, so the line is prose.
|a|b|<p>|a|b|</p>A term marker followed by a form feed has content, so it is a term.
::
: d<dl>
<dt></dt>
<dd>d</dd>
</dl>A trailing form feed stays in the term.
:: t
: d<dl>
<dt>t</dt>
<dd>d</dd>
</dl>A + followed by a form feed is not a continuation marker, in a description or an item, nested or not.
:: t
: +
b<dl>
<dt>t</dt>
<dd>+</dd>
</dl>
<p>b</p>- +
b<ul>
<li>+</li>
</ul>
<p>b</p>- a
- +
b<ul>
<li>a
<ul>
<li>+</li>
</ul>
</li>
</ul>
<p>b</p>A typed frontmatter opener may end in whitespace, not in a form feed.
---yaml
a: 1
---
t<p>---yaml
a: 1</p>
<hr>
<p>t</p>A heading reference does not fold a no-break space into a space. The heading holds one between the letters.
# a b
[a b][]<section id="a b">
<h1>a b</h1>
<p>[a b][]</p>
</section>Nor does it trim one. This heading starts with a no-break space.
# ab
[ab][]<section id=" ab">
<h1> ab</h1>
<p>[ab][]</p>
</section>A form feed after the combined /* opener does not refuse it either.
/*x*/ y<p><strong><em>x</em></strong> y</p>Emphasis span closes before a following delimiter
1 conformance fixture
A completed emphasis span closes at its valid closer regardless of what follows, per the §9 close-first rule: a valid closer closes the nearest matching open entry. So _z_ closes into <u>z</u> even when more bare delimiters come right after it. The trailing /y/ stays literal, because a / opener is suppressed immediately after the closing _ (the slash-adjacency guard above).
_z_/y/<p><u>z</u>/y/</p>Unclaimed openers stay literal
1 conformance fixture
Two forms that were proposed and then not adopted have no meaning in Carve, and both are pinned here so no engine can quietly start claiming them.
[>content] was the proposed sidenote form. It was dismissed, not deferred: a margin note is footnote content positioned by CSS, so it needs no syntax. The [> opener is unclaimed and the whole thing is literal text.
{:name:} was a proposed braced symbol form for intraword use. The brace is not part of any construct: it merely satisfies the symbol boundary guard, and the braces themselves stay literal. The name inside is a normal symbol, so with no symbols map configured it falls back to the literal :name: and the line renders exactly as written. See dismissed syntax.
[>foo]
{:tada:}<p>[>foo]</p>
<p>{:tada:}</p>Inline literal
3 conformance fixtures
A ! prefix on a verbatim span is an inline literal (PART 9 §27): the content is captured verbatim like a code span, but it renders as ordinary prose — no <code> wrapper — and is HTML-escaped and emitted by every renderer. It mirrors the $-math prefix, and exists so notation that collides with the bare emphasis delimiters (phonemic transcription /kaet/, glob patterns, paths) can be written without escaping each character.
The word cat is !`/kaet/` in IPA.<p>The word cat is /kaet/ in IPA.</p>A trailing {…} is the ordinary inline attribute block, so an attributed literal renders a <span> carrying it. The content is HTML-escaped, and no inline construct inside it is parsed.
!`/kaet/`{.ipa} and !`a<b>` and !`*not bold*`<p><span class="ipa">/kaet/</span> and a<b> and *not bold*</p>! still opens an image before [, and stays literal text everywhere else. A literal ! immediately before a backtick span is written \!.
\!`x` is a bang before code.<p>!<code>x</code> is a bang before code.</p>All-space verbatim content
3 conformance fixtures
The single-space strip on a verbatim span (PART 3 code_span) drops one leading and one trailing space, but not when the content consists entirely of space characters - those spans keep every space. Without this guard a formatter round-trip loses the content, since a span stripped to empty has no writable source spelling.
A single space ` ` and two spaces ` ` are preserved.<p>A single space <code> </code> and two spaces <code> </code> are preserved.</p>Ordinary content still strips one space from each side, so the guard is narrow.
But ` a ` strips one space from each side.<p>But <code>a</code> strips one space from each side.</p>The sigil-prefixed verbatim forms - the inline literal (section 27) and math (section 18) - share the same strip rule, so they keep all-space content too.
Literal !` ` and math $` ` keep their spaces.<p>Literal and math <span class="math inline" role="math">\( \)</span> keep their spaces.</p>A code span closes only on a run of its own length, whatever the length
10 conformance fixtures
477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-2477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-3477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-4477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-5477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-6477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-7477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-8477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-9477-a-code-span-closes-only-on-a-run-of-its-own-length-whatever-the-length-10
The opener is a maximal backtick run and the closer is a maximal run of the same count (PART 3 code_span), for a run of any length. A run of another length inside the span is content, and a run the span cannot close on leaves it open to the end of the block (markup-carve/carve#2144).
a ````b```` c<p>a <code>b</code> c</p>a ````b``` c<p>a <code>b``` c</code></p>a ````b```c```` d<p>a <code>b```c</code> d</p>a `b``c` d<p>a <code>b``c</code> d</p>a ````````b```````` c<p>a <code>b</code> c</p>The same pairing holds wherever a code span is skipped whole: inside a forced span, in a substitution or an insertion, and in an image's alt text, where it decides whether a caption line below finds its image.
{*a ````b```` c*} d<p><strong>a <code>b</code> c</strong> d</p>{~a ````~>```` b~>c~} d<p><del>a <code>~></code> b</del><ins>c</ins> d</p>{~a ````~}```` b~>c~} d<p><del>a <code>~}</code> b</del><ins>c</ins> d</p>{+a ````+}```` b+} c<p><ins>a <code>+}</code> b</ins> c</p>![a ````]```` b](i)
^ cap<figure>
<img src="i" alt="a ````]```` b">
<figcaption>cap</figcaption>
</figure>Adjacent slash and underscore emphasis nest
1 conformance fixture
/ and _ open immediately after each other when the preceding delimiter is a true opener, so adjacent pairs nest (they only stay literal as path protection when the preceding delimiter is a closer, e.g. /a/_b_).
/_x_/ and _/x/_<p><em><u>x</u></em> and <u><em>x</em></u></p>A delimiter after an underscore or slash opens only when that one pairs
6 conformance fixtures
484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs-2484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs-3484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs-4484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs-5484-a-delimiter-after-an-underscore-or-slash-opens-only-when-that-one-pairs-6
A delimiter never opens directly after _, nor / or _ directly after /, unless that _ or / is an open entry where the delimiter stands (CARVE-P3-013, markup-carve/carve#3973). Whether the guard closes later does not matter, so a guard at the start of a line lets the delimiter after it open and stays text itself, whatever the delimiter.
_*x* q
_/x/ q
/_x_ q
_~x~ q
_=x= q<p>_<strong>x</strong> q</p>
<p>_<em>x</em> q</p>
<p>/<u>x</u> q</p>
<p>_<s>x</s> q</p>
<p>_<mark>x</mark> q</p>The same after a space in mid-line.
a _*x* q<p>a _<strong>x</strong> q</p>CONTROL. A guard that pairs closes its own span around the inner one, so the spans nest.
_*x*_ q
/_x_/ q
_*x* y_ q<p><u><strong>x</strong></u> q</p>
<p><em><u>x</u></em> q</p>
<p><u><strong>x</strong> y</u> q</p>An unpaired guard leaves no open strong span to hold a forced one literal.
_*{*x*} q<p>_*<strong>x</strong> q</p>A caption's # placeholder inside the span after a guard is literal.

^ Figure _*# x* q<figure>
<img src="p.png" alt="p">
<figcaption>Figure _<strong># x</strong> q</figcaption>
</figure>Settling the guard does not move the quotes after it. The apostrophe follows a straight quote, so it closes.
_*x* \"'a' "<p>_<strong>x</strong> "’a’ “</p>Quote flanking after an escaped character
1 conformance fixture
A backslash-escaped character still flanks as the character it is, so a quote that follows it decides direction from the literal. \{ is an opening bracket and opens the quote; \< and \* are not, so the quote closes - the same decision the unescaped character produces. Escaping changes what the character is, not what it flanks like.
Worth pinning because the escape is consumed before the quote is resolved, so an implementation that loses the literal at that point silently flips the direction.
\{"quoted"\} and \<"q"\> and \*'q'\*
A \{ before a quote still opens it: \{"open"
Unescaped for contrast: {"open"}<p>{“quoted”} and <”q”> and *’q’*</p>
<p>A { before a quote still opens it: {“open”</p>
<p>Unescaped for contrast: {“open”}</p>A quote after a bare delimiter follows what that delimiter does
7 conformance fixtures
488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-2488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-3488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-4488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-5488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-6488-a-quote-after-a-bare-delimiter-follows-what-that-delimiter-does-7
A smart quote takes its side from the character before it (PART 3). A delimiter that opens a span puts the quote at the start of that span's content, which opens the quote; a delimiter that opens nothing is the preceding character, and none of *, _ and ~ is an opening context (markup-carve/carve#2164).
*"x"
a *"x" b
a **"x" b<p>*”x”</p>
<p>a *”x” b</p>
<p>a **”x” b</p>CONTROL. The same delimiters where they do open a span.
a *"x"* b
a ~*"x"* b<p>a <strong>“x”</strong> b</p>
<p>a ~<strong>“x”</strong> b</p>What stands before the opener does not reach the quote.
a.*"x"* b
a,_"x"_ b<p>a.<strong>“x”</strong> b</p>
<p>a,<u>“x”</u> b</p>A forced span's own delimiter opens it, so a quote at its content start opens.
x{*"y"*}<p>x<strong>“y”</strong></p>Inside it that delimiter is literal, and a quote after one closes.
{*a *"x"*}<p><strong>a *”x”</strong></p>A quote after a closed one follows the glyph that one took.
*"'x'<p>*”’x’</p>CONTROL. An intraword delimiter opens nothing, and / and = are opening characters in their own right.
a*"x"* b
/"x"
="x"<p>a*”x”* b</p>
<p>/“x”</p>
<p>=“x”</p>A caption's placeholder is any # that does not begin a tag
9 conformance fixtures
489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-2489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-3489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-4489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-5489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-6489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-7489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-8489-a-caption-s-placeholder-is-any-that-does-not-begin-a-tag-9
CARVE-P2-022 calls the first bare # in a caption's top-level text the number placeholder, and bare is "a # that does NOT begin a tag": one followed by whitespace, :, ., the caption's end, or any character a tag name does not take. A tag name takes letters, digits, _ and -, so every other character leaves the # bare (markup-carve/carve#2165).

^ Figure #* q<figure>
<img src="p.png" alt="p">
<figcaption>Figure 1* q</figcaption>
</figure>
^ Figure #, q<figure>
<img src="p.png" alt="p">
<figcaption>Figure 1, q</figcaption>
</figure>
^ Figure ## q<figure>
<img src="p.png" alt="p">
<figcaption>Figure 1# q</figcaption>
</figure>
^ Figure #é q<figure>
<img src="p.png" alt="p">
<figcaption>Figure 1é q</figcaption>
</figure>A # glued to digits begins no tag, because a tag name needs a letter (carve#4809), and a # before a tag-name character is never the placeholder (carve#4642), so #1 stays text.

^ Figure #1 q<figure>
<img src="p.png" alt="p">
<figcaption>Figure #1 q</figcaption>
</figure>
^ Figure #-a q<figure>
<img src="p.png" alt="p">
<figcaption>Figure <span class="tag"><strong>#-a</strong></span> q</figcaption>
</figure>Only the first bare # is the placeholder.

^ Figure x #* y #: z<figure>
<img src="p.png" alt="p">
<figcaption>Figure x 1* y #: z</figcaption>
</figure>A # glued to the word before it is still bare when a tag name cannot follow.

^ Figure#* q<figure>
<img src="p.png" alt="p">
<figcaption>Figure1* q</figcaption>
</figure>CONTROL. With a tag name after it the # is glued into the word instead.

^ Figure x#tag q<figure>
<img src="p.png" alt="p">
<figcaption>Figure x#tag q</figcaption>
</figure>A comment inside a forced span or the combined token ends at its closer
4 conformance fixtures
490-a-comment-inside-a-forced-span-or-the-combined-token-ends-at-its-closer490-a-comment-inside-a-forced-span-or-the-combined-token-ends-at-its-closer-2490-a-comment-inside-a-forced-span-or-the-combined-token-ends-at-its-closer-3490-a-comment-inside-a-forced-span-or-the-combined-token-ends-at-its-closer-4
CARVE-P9-042 names an explicit closer, not only a table cell's | or link text's ], as a boundary a %% comment does not cross: a forced span {X...X} at its X}, and the combined /*...*/ token at its */ (markup-carve/carve#2167). The comment still runs to a line break first where one comes sooner.
{*a %% b*} y<p><strong>a</strong> y</p>A different forced delimiter, the same bound.
{_a %% b_} y<p><u>a</u> y</p>The combined token, on one line and across a soft break.
/*a %% b*/ y<p><strong><em>a</em></strong> y</p>/*a %%c
b*/ y<p><strong><em>a
b</em></strong> y</p>An unresolved reference's literal source is HTML-escaped like any other text
3 conformance fixtures
PART 10 SS2 escapes &, < and > in text content, and a no-break space is the one exception: it serializes as , matching an escaped space and a line block's preserved indentation (markup-carve/carve#2168). An unresolved reference falls back to its literal source (PART 9R R1), and that source is text content like any other -- the fallback used to splice it in unescaped.
[ x][]
![ x][]<p>[ x][]</p>
<p>![ x][]</p>The same escaping reaches the label and an attribute block on an unresolved reference, not only the bracket text.
[x][a & b]
[x][]{title="a & b"}<p>[x][a & b]</p>
<p>[x][]{title="a & b"}</p>CONTROL. Plain source needs no escaping and renders unchanged.
[x][]<p>[x][]</p>Adjacent strong spans use HTML only where their delimiters merge
1 conformance fixture
PART 11 §8c requires Markdown delimiters where they read back as the same construct. Two adjacent strong spans need an HTML fallback for the second span because the two delimiter runs otherwise merge into one strong span.
{*a*}{*b*}<p><strong>a</strong><strong>b</strong></p>A braced comment does not decide a quote
7 conformance fixtures
552-a-braced-comment-does-not-decide-a-quote552-a-braced-comment-does-not-decide-a-quote-2552-a-braced-comment-does-not-decide-a-quote-3552-a-braced-comment-does-not-decide-a-quote-4552-a-braced-comment-does-not-decide-a-quote-5552-a-braced-comment-does-not-decide-a-quote-6552-a-braced-comment-does-not-decide-a-quote-7
Which half of a pair a " or ' resolves to follows the character that precedes it in the rendered text, so a construct contributing no character decides nothing. A braced comment renders nothing at all, which makes it the construct this is reachable through: inserting one must not flip an opening quote into a closing one (CARVE-P3-023, markup-carve/carve#2861).
A quote after { opens, and an empty comment between the two changes neither the rendered text nor the direction.
\{"q"<p>{“q”</p>\{{%%}"q"<p>{“q”</p>A comment at the start of the input leaves the quote at the start of the rendered text, and a comment after a space leaves the space.
{%%}"q"<p>“q”</p>x {% hidden %}"q"<p>x “q”</p>Content before the comment still decides the quote. An attribute block carries no character of its own either, but the content it attaches to does.
a{%%}"q"<p>a”q”</p>[x]{.c}{%%}"q"<p><span class="c">x</span>”q”</p>A single quote takes the same rule.
\{{%%}'q'<p>{‘q’</p>A below-column line continues a paragraph only where one is open
29 conformance fixtures
553-a-below-column-line-continues-a-paragraph-only-where-one-is-open553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-2553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-3553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-4553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-5553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-6553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-7553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-8553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-9553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-10553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-11553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-12553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-13553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-14553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-15553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-16553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-17553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-18553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-19553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-20553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-21553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-22553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-23553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-24553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-25553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-26553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-27553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-28553-a-below-column-line-continues-a-paragraph-only-where-one-is-open-29
A line below an item's content column is not that item's content. It reaches the document only through lazy continuation, which extends an OPEN PARAGRAPH and nothing else, so the question is asked at the deepest frame: a paragraph open there takes the line, and otherwise the list closes and the line begins a new block (CARVE-P0-024, markup-carve/carve#2884).
The clause used to carve out a heading and then hand the line to a surviving frame's paragraph anyway, which adopted a column-0 line into an item two columns to the right of it.
The ticket's shape, at two and three levels. The inner item's last block is a heading, which leaves no paragraph open, so lazy is a document paragraph rather than new content of an item whose content column it never reaches.
- a
- b
# N
lazy<ul>
<li>a
<ul>
<li>b
<h1 id="N">N</h1>
</li>
</ul>
</li>
</ul>
<p>lazy</p>- a
- b
- c
# N
lazy<ul>
<li>a
<ul>
<li>b
<ul>
<li>c
<h1 id="N">N</h1>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>lazy</p>A thematic break, a fenced code block, a ::: container and a table answer the same way, because the question is whether a paragraph is open and not which block kind closed it.
- a
- b
---
lazy<ul>
<li>a
<ul>
<li>b
<hr>
</li>
</ul>
</li>
</ul>
<p>lazy</p>- a
- b
```
code
```
lazy<ul>
<li>a
<ul>
<li>b
<pre><code>code
</code></pre>
</li>
</ul>
</li>
</ul>
<p>lazy</p>- a
- b
::: note
x
:::
lazy<ul>
<li>a
<ul>
<li>b
<aside class="admonition note" aria-label="Note">
<p>x</p>
</aside>
</li>
</ul>
</li>
</ul>
<p>lazy</p>- a
- b
|= h |
| c |
lazy<ul>
<li>a
<ul>
<li>b
<table>
<thead>
<tr><th scope="col">h</th></tr>
</thead>
<tbody>
<tr><td>c</td></tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
<p>lazy</p>The recursion is unchanged: follow the last child container to its leaf. A quote whose own last block is a heading holds no paragraph either.
- a
- b
> # H
lazy<ul>
<li>a
<ul>
<li>b
<blockquote>
<h1 id="H">H</h1>
</blockquote>
</li>
</ul>
</li>
</ul>
<p>lazy</p>A paragraph, a block quote, and a nested list whose leaf carries one, all hold an open paragraph, and the line folds into it. That is ordinary lazy continuation.
- a
- b
text
lazy<ul>
<li>a
<ul>
<li>b
text
lazy</li>
</ul>
</li>
</ul>- a
- b
> q
lazy<ul>
<li>a
<ul>
<li>b
<blockquote><p>q
lazy</p></blockquote>
</li>
</ul>
</li>
</ul>- a
- b
- c
lazy<ul>
<li>a
<ul>
<li>b
<ul>
<li>c
lazy</li>
</ul>
</li>
</ul>
</li>
</ul>A blank line closes the paragraph, so the line below it was never a continuation. A line at or past the content column is the item's own content and still continues it.
- a
- b
# N
lazy<ul>
<li>a
<ul>
<li>b
<h1 id="N">N</h1>
</li>
</ul>
</li>
</ul>
<p>lazy</p>- a
- b
# N
lazy<ul>
<li>a
<ul>
<li>b
<h1 id="N">N</h1>
</li>
</ul>
lazy
</li>
</ul>A verbatim payload is opaque, so a container opener written inside a code fence is text and reaches nothing. The paragraph below the closed fence is open in both spellings, and the line folds.
- a
- b
```
::: note
```
text
lazy<ul>
<li>a
<ul>
<li>b
<pre><code>::: note
</code></pre>
text
lazy
</li>
</ul>
</li>
</ul>- a
- b
::: note
x
:::
text
lazy<ul>
<li>a
<ul>
<li>b
<aside class="admonition note" aria-label="Note">
<p>x</p>
</aside>
text
lazy
</li>
</ul>
</li>
</ul>A closed fence opened on nested markers leaves no paragraph for a below-column line. This applies to list items and description bodies (carve#2895). An unfinished opener keeps its first body line inside its fence.
- - ```
```
x<ul>
<li>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</li>
</ul>
<p>x</p>- - ```
```
```<ul>
<li>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</li>
</ul>
<pre><code></code></pre>- - ```
x<ul>
<li>
<ul>
<li>
<pre><code>x
</code></pre>
</li>
</ul>
</li>
</ul>:: t
: - - ```
```
x<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</li>
</ul>
</dd>
</dl>
<p>x</p>:: t
: - - ```
```
```<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</li>
</ul>
</dd>
</dl>
<pre><code></code></pre>:: t
: - - ```
x<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<ul>
<li>
<pre><code>x
</code></pre>
</li>
</ul>
</li>
</ul>
</dd>
</dl>Raw fences and deeper marker stacks answer the same question. A nested heading or table also leaves no paragraph open in a description body. The last control leaves the below-column run outside the description body and its nested fence.
- - ```=html
```
x<ul>
<li>
<ul>
<li>
</li>
</ul>
</li>
</ul>
<p>x</p>- - ```=html
```
```rust<ul>
<li>
<ul>
<li>
</li>
</ul>
</li>
</ul>
<pre><code class="language-rust"></code></pre>- - - ```
```
x<ul>
<li>
<ul>
<li>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>x</p>:: t
: - # h
x<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<h1 id="h">h</h1>
</li>
</ul>
</dd>
</dl>
<p>x</p>:: t
: - a
# H
tail<dl>
<dt>t</dt>
<dd>
<ul>
<li>a
<h1 id="H">H</h1>
</li>
</ul>
</dd>
</dl>
<p>tail</p>:: t
: - a
# H
tail<dl>
<dt>t</dt>
<dd>
<ul>
<li>a
<h1 id="H">H</h1>
</li>
</ul>
</dd>
</dl>
<p>tail</p>:: t
: - a
# H
tail<dl>
<dt>t</dt>
<dd>
<ul>
<li>a
<h1 id="H">H</h1>
</li>
</ul>
</dd>
</dl>
<p>tail</p>:: t
: - |= a |
x<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<table>
<thead>
<tr><th scope="col">a</th></tr>
</thead>
</table>
</li>
</ul>
</dd>
</dl>
<p>x</p>:: t
: - ```
```<dl>
<dt>t</dt>
<dd>
<ul>
<li>
<pre><code></code></pre>
</li>
</ul>
</dd>
</dl>
<pre><code></code></pre>A closed block leaves no frame for the line below
15 conformance fixtures
556-a-closed-block-leaves-no-frame-for-the-line-below556-a-closed-block-leaves-no-frame-for-the-line-below-2556-a-closed-block-leaves-no-frame-for-the-line-below-3556-a-closed-block-leaves-no-frame-for-the-line-below-4556-a-closed-block-leaves-no-frame-for-the-line-below-5556-a-closed-block-leaves-no-frame-for-the-line-below-6556-a-closed-block-leaves-no-frame-for-the-line-below-7556-a-closed-block-leaves-no-frame-for-the-line-below-8556-a-closed-block-leaves-no-frame-for-the-line-below-9556-a-closed-block-leaves-no-frame-for-the-line-below-10556-a-closed-block-leaves-no-frame-for-the-line-below-11556-a-closed-block-leaves-no-frame-for-the-line-below-12556-a-closed-block-leaves-no-frame-for-the-line-below-13556-a-closed-block-leaves-no-frame-for-the-line-below-14556-a-closed-block-leaves-no-frame-for-the-line-below-15
Since markup-carve/carve#4907 a %%% opener opens its span with no closer lookahead: without a closer it hides everything up to a line that misses its owner or the end of its container (PART 9 §28). The rows below follow that reading; where the prose describes a closerless opener as a %% line or a closer ahead as deciding the span, it records the reading the ruling replaced.
Since markup-carve/carve#4860 a list marker opens a list in a list item, description body or footnote body and closes a body it misses, so the rows below that show a marker in such a body read that way.
CARVE-P0-024 asks one question of a line below an item's content column: is a paragraph open at the deepest frame? Where the last block there is closed, the line closes the list and begins a new block, and no surviving frame adopts it. These documents pin the answer in the shapes where a reader kept the line in a frame that had ended (markup-carve/carve#2925).
A fence opener with no closer under the item's paragraph. The first run interrupts the paragraph (§10 I4) and opens a code block that runs to the end of the item, so the blank, the tilde lines and anything between them are its content. A fenced body is not a paragraph, and after is a document paragraph (markup-carve/carve#2949). A thematic break between the two changes nothing.
- a
```
~~~
code
~~~
after<ul>
<li>a
<pre><code>
~~~
code
~~~
</code></pre>
</li>
</ul>
<p>after</p>- a
```
---
~~~
code
~~~
after<ul>
<li>a
<pre><code>
---
~~~
code
~~~
</code></pre>
</li>
</ul>
<p>after</p>A line of prose after the tilde block is code content too, and after still leaves the item.
- a
```
~~~
code
~~~
more
after<ul>
<li>a
<pre><code>
~~~
code
~~~
more
</code></pre>
</li>
</ul>
<p>after</p>An empty container in a quoted nested item. Its item holds no paragraph, so the unmarked line closes the quote and opens a document list, whether or not an unrelated list stands above. The second source puts the container in the outer item.
> - a
> - b
> - c
> :::
1. lazy<blockquote>
<ul>
<li>a</li>
<li>b
<ul>
<li>c
<div>
</div>
</li>
</ul>
</li>
</ul>
</blockquote>
<ol>
<li>lazy</li>
</ol>> - a
> - b
> - c
> :::
1. lazy<blockquote>
<ul>
<li>a</li>
<li>b
<ul>
<li>c</li>
</ul>
<div>
</div>
</li>
</ul>
</blockquote>
<ol>
<li>lazy</li>
</ol>The two controls of markup-carve/carve#2925. A closed container on a quoted marker line stores no claim, and a column cannot supply the quote prefix, so tail opens a document list at either column.
> - ::: box
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> - ::: box
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>A block at a quoted item's content column is read by that item, and it leaves the quote no paragraph either.
> - a
> # H
tail<blockquote>
<ul>
<li>a
<h1 id="H">H</h1>
</li>
</ul>
</blockquote>
<p>tail</p>A quote inside an item answers with its own last block on every line, not only on the marker line.
- a
> # H
tail<ul>
<li>a
<blockquote>
<h1 id="H">H</h1>
</blockquote>
</li>
</ul>
<p>tail</p>A fence on a sublist's marker line is closed like any other, and the line below it is not the outer item's.
- a
- ```
x
```
tail<ul>
<li>a
<ul>
<li>
<pre><code>x
</code></pre>
</li>
</ul>
</li>
</ul>
<p>tail</p>A code block in a footnote body on a marker line. Every line of the body is the definition's, so the item holds no paragraph after it and below leaves the list, with one code block or two and with or without a child line.
- [^a]: text
[^b]: inner
~~~
one
~~~
~~~
two
~~~
below
[^a] [^b]<ul>
<li></li>
</ul>
<p>below</p>
<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> <a id="fnref2" href="#fn2" role="doc-noteref"><sup>2</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>text<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
<li id="fn2">
<p>inner</p>
<pre><code>one
</code></pre>
<pre><code>two
</code></pre>
<p><a href="#fnref2" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>- [^a]: text
- child
[^b]: inner
~~~
one
~~~
below
[^a] [^b]<ul>
<li></li>
</ul>
<p>below</p>
<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> <a id="fnref2" href="#fn2" role="doc-noteref"><sup>2</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>text</p>
<ul>
<li>child</li>
</ul>
<p><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
<li id="fn2">
<p>inner</p>
<pre><code>one
</code></pre>
<p><a href="#fnref2" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A comment below the content column is not a line of the container. The colon opener on the marker line has opened an empty container, the item holds no paragraph, and the line below the comment is a document paragraph, as it is after a container closed on the next line.
- ::: inner
%% c
text<ul>
<li>
<div class="inner">
</div>
</li>
</ul>
<p>text</p>An unmatched comment fence is the line form (CARVE-P0-005), so it grants and refuses ownership exactly as %% does. A comment below the item's column closes neither item (carve#4862, which replaced markup-carve/carve#2950), so the follower at the item's column stays where it was.
- ::: box
%%%%
%% j
x<ul>
<li>
<div class="box">
</div>
</li>
</ul>- a
%%%%
%%%
x<ul>
<li>a</li>
</ul>A line retained after a comment opens a paragraph
5 conformance fixtures
A comment at or past an item’s content column closes its paragraph and grants no retention to a following below-column line; only a comment consumed below that column grants retention (CARVE-P0-024, CARVE-P0-005).
> - ::: box
> - inner
> %%%
> hidden
> %%%
> ```
> code
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>inner</li>
</ul>
<pre><code>code
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> - ::: box
> - ::: inner
> %%%
> hidden
> %%%
> ```
> code
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="inner">
</div>
</li>
</ul>
<pre><code>code
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>The below-column line belongs to the outer item after the sublist, and the flush-left line continues its paragraph.
- a
- inner
%% c
code
tail<ul>
<li>a
<ul>
<li>inner
code
tail</li>
</ul>
</li>
</ul>The below-column line opens a document paragraph. A following list marker does not interrupt it; a line at document column 0 also leaves the item.
- inner
%% c
code
- tail<ul>
<li>inner
code</li>
<li>tail</li>
</ul>- inner
%% c
code
tail<ul>
<li>inner
code
tail</li>
</ul>An at-column comment retains nothing
2 conformance fixtures
A comment at or past the content column closes the item’s paragraph and grants no retention to the following below-column line (CARVE-P0-024, CARVE-P0-005).
> - ::: box
> - ::: inner
> %% c
> text
tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="inner">
</div>
</li>
</ul>
<p>text
tail</p>
</div>
</li>
</ul>
</blockquote>- inner
%% c
code
- tail<ul>
<li>inner
code</li>
<li>tail</li>
</ul>A shifted fence in a quoted container's body stores no continuation claim
2 conformance fixtures
A fence that opens past a quoted container’s body column leaves no paragraph for an unmarked line to continue (CARVE-P0-013, CARVE-P0-006).
> - ::: box
> ```
> code
tail<blockquote>
<ul>
<li>
<div class="box">
<pre><code>code
</code></pre>
</div>
</li>
</ul>
</blockquote>
<p>tail</p>> > - ::: box
> > - inner
> > %% c
> > ```
> > code
- tail<blockquote>
<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>inner</li>
</ul>
<pre><code>code
</code></pre>
</div>
</li>
</ul>
</blockquote>
</blockquote>
<ul>
<li>tail</li>
</ul>A container boundary is read at the container's own column
5 conformance fixtures
558-a-container-boundary-is-read-at-the-container-s-own-column558-a-container-boundary-is-read-at-the-container-s-own-column-2558-a-container-boundary-is-read-at-the-container-s-own-column-3558-a-container-boundary-is-read-at-the-container-s-own-column-4558-a-container-boundary-is-read-at-the-container-s-own-column-5
Two boundaries a reader placed by indentation instead of by the container that owns the line: an opener past the content column of a hosted container, and a fence closer written after its item had ended (markup-carve/carve#2925).
A named colon opener written past the content column inside a container an item hosts. The opener is recognized and takes its authored column as the base of that one block (CARVE-P0-024, markup-carve/carve-php#3137). The quoted spelling reads the same way, and with the box left unclosed the line below still leaves the quote.
- ::: box
::: note
x::: tail
```html
<ul>
<li>
<div class="box">
<aside class="admonition note" aria-label="Note">
<p>x</p>
</aside>
</div>
</li>
</ul>
<p>tail</p>
```
:::
::: compare
````carve
> - ::: box
> ::: note
> x
> :::
tail<blockquote>
<ul>
<li>
<div class="box">
<aside class="admonition note" aria-label="Note">
<p>x</p>
</aside>
</div>
</li>
</ul>
</blockquote>
<p>tail</p>:::
Under a paragraph of the box the same opener closes the paragraph and establishes its own base (CARVE-P9-083, CARVE-P0-024).
- ::: box
text
::: note
x
:::
:::
tail<ul>
<li>
<div class="box">
<p>text</p>
<aside class="admonition note" aria-label="Note">
<p>x</p>
</aside>
</div>
</li>
</ul>
<p>tail</p>A fence run after a nested item has ended. The blank and the heading at the outer item's column end the child item, so the later run is not inside it and closes nothing: the first run opens a code block that the heading ends (CARVE-P0-014, markup-carve/carve#2961). The later run is past the outer item's column with no paragraph open, so it opens a code block of its own (CARVE-P0-024). The top-level spelling reads the first run the same way.
- outer
- para
```
code
# h
```<ul>
<li>outer
<ul>
<li>para
<pre><code>code
</code></pre>
</li>
</ul>
<h1 id="h">h</h1>
<pre><code></code></pre>
</li>
</ul>- a
```
b
y
```<ul>
<li>a
<pre><code>b
</code></pre>
</li>
</ul>
<p>y</p>
<pre><code></code></pre>A description keeps a block at its body column whatever leads the item
7 conformance fixtures
560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-2560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-3560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-4560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-5560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-6560-a-description-keeps-a-block-at-its-body-column-whatever-leads-the-item-7
A list item whose marker line is a definition term. A block that reaches the description body's column stays in the description, after a blank and without one, exactly as it does when ordinary text leads the item (CARVE-P9-083, CARVE-P0-024, ruled on markup-carve/carve-php#3174). The description ends on that block and holds no paragraph, so the line below leaves the list (CARVE-P0-024).
- :: term
: definition
```
code
```
after<ul>
<li>
<dl>
<dt>term</dt>
<dd>
<p>definition</p>
<pre><code>code
</code></pre>
</dd>
</dl>
</li>
</ul>
<p>after</p>- :: term
: desc
```
code
```
after<ul>
<li>
<dl>
<dt>term</dt>
<dd>
<p>desc</p>
<pre><code>code
</code></pre>
</dd>
</dl>
</li>
</ul>
<p>after</p>> - :: term
> : definition
>
> ```
> code
> ```
after<blockquote>
<ul>
<li>
<dl>
<dt>term</dt>
<dd>
<p>definition</p>
<pre><code>code
</code></pre>
</dd>
</dl>
</li>
</ul>
</blockquote>
<p>after</p>The same line below a description or a quote in an item that ends on a code block. No paragraph is open at the deepest frame, so no surviving frame adopts the line (CARVE-P0-024).
- intro
:: term
: definition
```
code
```
after<ul>
<li>intro
<dl>
<dt>term</dt>
<dd>
<p>definition</p>
<pre><code>code
</code></pre>
</dd>
</dl>
</li>
</ul>
<p>after</p>- intro
> ```
> code
> ```
after<ul>
<li>intro
<blockquote>
<pre><code>code
</code></pre>
</blockquote>
</li>
</ul>
<p>after</p>The controls. A paragraph at the body's column keeps the description open for the line below, and a block at the item's own column after a blank is the item's.
- :: term
: definition
para
after<ul>
<li>
<dl>
<dt>term</dt>
<dd>
<p>definition</p>
<p>para
after</p>
</dd>
</dl>
</li>
</ul>- :: term
: definition
```
code
```
after<ul>
<li>
<dl>
<dt>term</dt>
<dd>definition</dd>
</dl>
<pre><code>code
</code></pre>
</li>
</ul>
<p>after</p>A line-block payload span pairs past the content column
3 conformance fixtures
Since markup-carve/carve#4860 a list marker opens a list in a list item, description body or footnote body and closes a body it misses, so the rows below that show a marker in such a body read that way.
Two fence-shaped runs written past the content column in a line-block payload. The payload is inline content, so the runs pair as one span and the colon run between them is payload, exactly as at the content column (ruled on markup-carve/carve-php#3137). The line block closes at the second :::, and the lines after it read as they do in the content-column spelling: :::bad is text and the bare ::: opens a div (carve#4863).
> - ::: |
> ```
> :::
> ```
> :::
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="line-block">
<p> <code>
:::
</code></p>
</div>
:::bad
<div>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>- ::: |
```
:::
```
:::
para
tail<ul>
<li>
<div class="line-block">
<p> <code>
:::
</code></p>
</div>
para
tail
</li>
</ul>The control. A lone run pairs with nothing, so the first ::: closes the line block.
- ::: |
```
:::
para
tail<ul>
<li>
<div class="line-block">
<p> <code></code></p>
</div>
para
tail
</li>
</ul>A quoted item that ends on a block past its column holds no paragraph
4 conformance fixtures
An opener past a nested item's content column inside a quote. The heading is rebased into the item (CARVE-P0-024), which then holds no paragraph, so no frame of the quote adopts the line below (CARVE-P0-024, markup-carve/carve#2960). In the second document the backtick run opens a fence under the item's paragraph, so the tilde lines below it are its content.
> - b
> - c
> # h
tail<blockquote>
<ul>
<li>b
<ul>
<li>c
<h1 id="h">h</h1>
</li>
</ul>
</li>
</ul>
</blockquote>
<p>tail</p>> - a
> ```
> ~~~
> code
> ~~~
tail<blockquote>
<ul>
<li>a
<pre><code>~~~
code
~~~
</code></pre>
</li>
</ul>
</blockquote>
<p>tail</p>The control. Text past the column establishes no base and the paragraph stays open.
> - b
> - c
> text
tail<blockquote>
<ul>
<li>b
<ul>
<li>c
text
tail</li>
</ul>
</li>
</ul>
</blockquote>A marker in a line-block payload is payload. It opens no sublist and the run after it opens no code block, so the line below folds into the payload as it does after any other payload line.
- ::: |
- ```
tail<ul>
<li>
<div class="line-block">
<p>- <code>
tail</code></p>
</div>
</li>
</ul>An opener past a hosted container's column opens there
5 conformance fixtures
A recognized block opener past the content column of a colon container that a list item hosts takes its authored column as the base of that one block (CARVE-P0-024, CARVE-P9-083, ruled on markup-carve/carve#2973). The line-block spelling, a code fence and a heading open like a named container does, with the container on the marker line or below it, quoted or not.
- ::: box
::: |
x
:::
:::
tail<ul>
<li>
<div class="box">
<div class="line-block">
<p>x</p>
</div>
</div>
</li>
</ul>
<p>tail</p>- a
::: box
```
code
```
:::
tail<ul>
<li>a
<div class="box">
<pre><code>code
</code></pre>
</div>
</li>
</ul>
<p>tail</p>> - ::: box
> # h
tail<blockquote>
<ul>
<li>
<div class="box">
<h1 id="h">h</h1>
</div>
</li>
</ul>
</blockquote>
<p>tail</p>Under a paragraph of the container the same opener closes the paragraph and opens its block (CARVE-P9-083, CARVE-P0-024).
- ::: box
text
::: |
x
:::
:::
tail<ul>
<li>
<div class="box">
<p>text</p>
<div class="line-block">
<p>x</p>
</div>
</div>
</li>
</ul>
<p>tail</p>A block at the item's column ends a sublist above it, so a later run past that column belongs to the item and opens there too.
- outer
- para
---
```<ul>
<li><p>outer</p>
<ul>
<li>para</li>
</ul>
<hr>
<pre><code></code></pre>
</li>
</ul>A fence that leaves a closed nested item opens in the host it lands in
10 conformance fixtures
581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-2581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-3581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-4581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-5581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-6581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-7581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-8581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-9581-a-fence-that-leaves-a-closed-nested-item-opens-in-the-host-it-lands-in-10
A closed block leaves no paragraph open, so a fence run below a nested item's column leaves that item and is read in the enclosing host (CARVE-P0-024). With nothing to interrupt and no closer to take, an unclosed fence opens a code block that runs to the end of that host, and a bare ::: past a box's column is text, not the box's closer (PART 2 admonition, A CLOSER IS REQUIRED). A fence below the sublist's column interrupts its paragraph whether or not a closer follows (CARVE-P0-014) and opens in the enclosing host. A fence-shaped line-block payload line opens nothing, so the box reads the same when that line is plain text. A ::: inside an open code fence is code text.
> - ::: box
> - ::: |
> ```
> :::
> ```
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="line-block">
<p><code></code></p>
</div>
</li>
</ul>
<pre><code>:::bad
:::
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> 1. ::: box
> - ::: |
> ```
> x
> ```
> :::
> ```
> - x
> ```<blockquote>
<ol>
<li>
<div class="box">
<ul>
<li>
<div class="line-block">
<p><code>
x
</code></p>
</div>
</li>
</ul>
<pre><code>- x
</code></pre>
</div>
</li>
</ol>
<pre><code></code></pre>
</blockquote>> - ::: box
> - ::: |
> ```
> :::
> ```
> :::
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="line-block">
<p><code></code></p>
</div>
</li>
</ul>
<pre><code>:::
:::bad
:::
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> - a
> - child
> ```
>
> ```
> ~~~
after<blockquote>
<ul>
<li>a
<ul>
<li>child</li>
</ul>
<pre><code></code></pre>
</li>
</ul>
</blockquote>
<p>after</p>
```- a
- child
```
code
```
after<ul>
<li>a
<ul>
<li>child</li>
</ul>
<pre><code>code
</code></pre>
</li>
</ul>
<p>after</p>> - a
> - child
> ```
> code
> ```
after<blockquote>
<ul>
<li>a
<ul>
<li>child</li>
</ul>
<pre><code>code
</code></pre>
</li>
</ul>
</blockquote>
<p>after</p>- a
- child
```
code
after<ul>
<li>a
<ul>
<li>child</li>
</ul>
<pre><code>code
</code></pre>
</li>
</ul>
<p>after</p>> - ::: box
> - ::: |
> x
> :::
> ```
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="line-block">
<p>x</p>
</div>
</li>
</ul>
<pre><code>:::bad
:::
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> - ::: box
> - ::: |
> x
> :::
> ```
> :::
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
<ul>
<li>
<div class="line-block">
<p>x</p>
</div>
</li>
</ul>
<pre><code>:::
:::bad
:::
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>> - ::: box
> ```
> :::bad
> :::
- tail<blockquote>
<ul>
<li>
<div class="box">
<pre><code>:::bad
:::
</code></pre>
</div>
</li>
</ul>
</blockquote>
<ul>
<li>tail</li>
</ul>A footnote definition past a box's column is hoisted
1 conformance fixture
A footnote definition past a colon body's content column is a block on its authored base, so it is hoisted like one at the box's own column (CARVE-P0-024, CARVE-P9-083).
- ::: box
[^n]: note
:::
ref[^n]<ul>
<li>
<div class="box">
</div>
</li>
</ul>
<p>ref<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>note<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A link definition or an attribute line past a box's column opens on its authored base
3 conformance fixtures
A link definition or attribute line past a box's content column opens on its authored base (CARVE-P0-024, CARVE-P0-011, CARVE-P9-083), as a footnote definition there is hoisted (corpus 582).
- ::: box
[r]: /u
:::
see [x][r]<ul>
<li>
<div class="box">
</div>
</li>
</ul>
<p>see <a href="/u">x</a></p>- ::: box
{.k}
para
:::<ul>
<li>
<div class="box">
<p class="k">para</p>
</div>
</li>
</ul>The same definition at the box's own column already opens there.
- ::: box
[r]: /u
:::
see [x][r]<ul>
<li>
<div class="box">
</div>
</li>
</ul>
<p>see <a href="/u">x</a></p>A block quote and a footnote body take the first-block form
8 conformance fixtures
588-a-block-quote-and-a-footnote-body-take-the-first-block-form588-a-block-quote-and-a-footnote-body-take-the-first-block-form-2588-a-block-quote-and-a-footnote-body-take-the-first-block-form-3588-a-block-quote-and-a-footnote-body-take-the-first-block-form-4588-a-block-quote-and-a-footnote-body-take-the-first-block-form-5588-a-block-quote-and-a-footnote-body-take-the-first-block-form-6588-a-block-quote-and-a-footnote-body-take-the-first-block-form-7588-a-block-quote-and-a-footnote-body-take-the-first-block-form-8
> + and [^a]: + over a flush-left block open a body that is that one block, the same reach as - + and : + (§17 L4, markup-carve/carve#3105). With no flush-left block after it, the + stays the container's text.
A table under > + is the quote's body.
> +
|= 2-col header | < |= header |<blockquote>
<table>
<thead>
<tr><th scope="col" colspan="2">2-col header</th><th scope="col">header</th></tr>
</thead>
</table>
</blockquote>A paragraph under > + is the quote's paragraph, not a fold into +.
> +
flush<blockquote><p>flush</p></blockquote>At the end of the input the + is the quote's text.
> +<blockquote>
</blockquote>A blank line next gives the same answer, and the line after the blank is a top-level paragraph.
> +
after<blockquote>
</blockquote>
<p>after</p>A nested quote's follower needs the outer quote's prefix. The fence has none, so the + stays the inner quote's text and the fence stands outside (carve#4409).
> > +
```
x
```<blockquote>
<blockquote>
</blockquote>
</blockquote>
<pre><code>x
</code></pre>A fence under [^a]: + is the note's body.
[^a]: +
```
x
```
see[^a]<p>see<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<pre><code>x
</code></pre>
<p><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A note whose + ends the input holds the text +.
see[^a]
[^a]: +<p>see<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>So does a note with a blank line next.
[^a]: +
see[^a]<p>see<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>An opener past a hosted container's column interrupts its open paragraph
2 conformance fixtures
A recognized opener past an item-hosted colon body's column interrupts its open paragraph as it does in an item (CARVE-P9-083, CARVE-P0-024).
- ::: box
text
# h
:::<ul>
<li>
<div class="box">
<p>text</p>
<h1 id="h">h</h1>
</div>
</li>
</ul>> - ::: box
> text
> ```
> x
> ```
> :::<blockquote>
<ul>
<li>
<div class="box">
<p>text</p>
<pre><code>x
</code></pre>
</div>
</li>
</ul>
</blockquote>A closed fence in a quoted sub-item after a lazy line leaves no paragraph
2 conformance fixtures
A lazy line folds into the paragraph of the nested item, and a fence at that item's column then closes it. The closed code block leaves no paragraph in any frame, so the unmarked line below closes the quote and the list (CARVE-P0-024, markup-carve/carve#2973). The unquoted spelling reads the same way.
> - a
> - c
> b
> ```
> y
> ```
flush<blockquote>
<ul>
<li>a
<ul>
<li>c
b
<pre><code>y
</code></pre>
</li>
</ul>
</li>
</ul>
</blockquote>
<p>flush</p>- a
- c
b
```
y
```
flush<ul>
<li>a
<ul>
<li>c
b
<pre><code>y
</code></pre>
</li>
</ul>
</li>
</ul>
<p>flush</p>A caption scope resets at a structural-only line
3 conformance fixtures
A caption attaches to a host. A line that is empty once its block structural prefix is removed - a bare > - carries layout and no content, so it is not one of the blanks the one-blank caption allowance counts. Where it changes the open container it ends the scope above it, and the container it opens holds nothing a caption could be about (CARVE-P9-080, markup-carve/carve#2892).
A bare > between a table and a ^ line used to count as blank, so the quote it opened became a captioned figure and the caption bound to a host nobody wrote it under. Neither the table nor the empty quote is captioned now; the ^ line has no captionable block above it and is ordinary paragraph text.
| a |
>
^ cap<table>
<tbody>
<tr><td>a</td></tr>
</tbody>
</table>
<blockquote>
</blockquote>
<p>^ cap</p>Adjacency does not change the answer: the quote is empty either way.
>
^ cap<blockquote>
</blockquote>
<p>^ cap</p>The control. A quote with content still captions, and a bare > INSIDE it is not a container change, so a trailing one does not detach the caption.
> q
>
^ cap<figure>
<blockquote><p>q</p></blockquote>
<figcaption>cap</figcaption>
</figure>A quote after an escaped quote closes
5 conformance fixtures
A smart quote takes its side from the character before it (PART 3). An escaped quote renders as the straight character, which is not an opening context, so the quote after it closes, whichever quote came before the escape (markup-carve/carve#2158).
"a\""
"\""<p>“a"”</p>
<p>“"”</p>The same for the single quote.
'a\''<p>‘a'’</p>The escape and the quote after it need not be the same character.
"a\''
'a\""<p>“a'’</p>
<p>‘a"”</p>An apostrophe after an escaped quote inside a quotation closes too.
"\"'q'"<p>“"’q’”</p>CONTROL. After an unescaped opening quote a quote opens, so quotations nest.
"'q'"<p>“‘q’”</p>A combined bold-italic span may cross a line
1 conformance fixture
/*…*/ is one construct (bold_italic), and like any inline span it folds across the lines of its paragraph. The nesting is the same either way: strong outside emphasis. Nothing pinned the multi-line form, and the oracle inverted it there - pairing the two delimiters separately gives emphasis outside strong.
/*multi
line*/<p><strong><em>multi
line</em></strong></p>The combined bold-italic token does not open or close inside a word
8 conformance fixtures
601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-2601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-3601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-4601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-5601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-6601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-7601-the-combined-bold-italic-token-does-not-open-or-close-inside-a-word-8
bold_italic opens with bare_opener('/') and closes with bare_closer('/'), so a letter or digit against its outer / stops the combined token exactly as it stops a plain /. The opener fails after a letter:
a/*y*/ b<p>a/<strong>y</strong>/ b</p>and the closer fails before one:
a /*y*/b<p>a /<strong>y</strong>/b</p>A digit counts the same way on either side:
2/*a*/ and /*b*/3<p>2/<strong>a</strong>/ and /<strong>b</strong>/3</p>Paths and globs keep every character. The inner * pair is an ordinary bold span, and a second * opener while bold is open is text (PART 9 §9 E3):
Run src/*test*/fixtures now<p>Run src/<strong>test</strong>/fixtures now</p>see lib/*.js and src/*foo*/bar<p>see lib/<strong>.js and src/*foo</strong>/bar</p>A */ before a letter is not a closer, so the nearest valid one closes the token and the rejected pair is content:
/*a*/b c*/<p><strong><em>a*/b c</em></strong></p>Intraword emphasis takes the forced form, which has no word boundary (PART 9 §22):
a{/*y*/}b<p>a<em><strong>y</strong></em>b</p>At a word boundary the combined token forms as before:
/*a*/ b<p><strong><em>a</em></strong> b</p>The combined bold-italic token does not open after an underscore or a slash
4 conformance fixtures
602-the-combined-bold-italic-token-does-not-open-after-an-underscore-or-a-slash602-the-combined-bold-italic-token-does-not-open-after-an-underscore-or-a-slash-2602-the-combined-bold-italic-token-does-not-open-after-an-underscore-or-a-slash-3602-the-combined-bold-italic-token-does-not-open-after-an-underscore-or-a-slash-4
The outer / of /*...*/ takes all of bare_opener('/'), so a _ or a / directly before it keeps it from opening, as it does for a plain /. The inner * pair is then an ordinary bold span:
a_/*y*/ x<p>a_/<strong>y</strong>/ x</p>//*y*/ x<p>//<strong>y</strong>/ x</p>see snake_/*glob*/ now<p>see snake_/<strong>glob</strong>/ now</p>A _ that opens a span that closes is markup, not the character before the token (PART 9 §9), so the token still forms inside an underline:
_/*x*/_<p><u><strong><em>x</em></strong></u></p>The combined bold-italic token does not open inside an open bare italic or bold
4 conformance fixtures
603-the-combined-bold-italic-token-does-not-open-inside-an-open-bare-italic-or-bold603-the-combined-bold-italic-token-does-not-open-inside-an-open-bare-italic-or-bold-2603-the-combined-bold-italic-token-does-not-open-inside-an-open-bare-italic-or-bold-3603-the-combined-bold-italic-token-does-not-open-inside-an-open-bare-italic-or-bold-4
The combined token holds an italic and a bold, and PART 9 §9 allows no bare same-type nesting, so it does not open while a bare / or * span is open. Its first / cannot close either (whitespace precedes it), so it is text, the * pair is bold, and the / after it closes the outer italic:
/a /*x*/ b/<p><em>a /<strong>x</strong></em> b/</p>The same holds inside a bare bold. The * after the text / cannot close (a letter follows it) and cannot open (a bold is open), so the next * closes the outer bold:
*a /*x*/ b*<p><strong>a /*x</strong>/ b*</p>With no italic or bold open, the token forms as usual:
/*x*/ and /b/<p><strong><em>x</em></strong> and <em>b</em></p>A braced span nests inside a bare span of its own kind:
/a {/*x*/} b/<p><em>a <em><strong>x</strong></em> b</em></p>A bare closer does not reach inside a braced inline
3 conformance fixtures
A code span and a braced inline are opaque to a bare delimiter (PART 9 §9 E2a). A bare ~ inside {/y~/} cannot close the strike opened before the braces, so that ~ is literal content of the italic span, and the leading ~, left with no closer it can reach, is literal too.
~{/x/}{/y~/}<p>~<em>x</em><em>y~</em></p>The outer span still closes at a bare closer outside the braces. Every member of the braced family is opaque, the editorial forms as well as the forced spans.
~a{+b~+} c~<p><s>a<ins>b~</ins> c</s></p>The rule is the same for every bare delimiter.
*a {_b* c_} d*<p><strong>a <u>b* c</u> d</strong></p>A bare closer does not reach inside a link destination
2 conformance fixtures
A link destination and an autolink are opaque to a bare delimiter (PART 9 §9 E2a), so the slashes of a URL cannot close emphasis opened before the link.
/see [x](http://a.b/c) now/<p><em>see <a href="http://a.b/c">x</a> now</em></p>/see <http://a.b/c> now/<p><em>see <a href="http://a.b/c">http://a.b/c</a> now</em></p>A bare closer does not reach inside a cross-reference
2 conformance fixtures
A cross-reference is opaque to a bare delimiter like an autolink (PART 8 ranks both above emphasis, PART 9 §9 E2a), so the slash of </#id> cannot close emphasis opened before it, whether or not the target resolves.
{#intro}
# Intro
x /a </#intro> y<section id="intro">
<h1>Intro</h1>
<p>x /a <a href="#intro">Intro</a> y</p>
</section>x /a </#nothing> y<p>x /a </#nothing> y</p>An autolink or a cross-reference is atomic to brackets and braces
3 conformance fixtures
PART 8 resolves an autolink or a cross-reference before links and emphasis, so a [ inside one opens no bracket run: the parenthesis after a later ] is no destination, and emphasis pairs across it. A braced closer inside a cross-reference cannot close a forced span opened before it (PART 9 §9 E2a).
<https://a[> *q](u*) z<p><a href="https://a[">https://a[</a> <strong>q](u</strong>) z</p></#a[> *q](u*) z<p></#a[> <strong>q](u</strong>) z</p>{*a </#x*}> b*}<p><strong>a </#x*}> b</strong></p>Editorial markup closes outside a cross-reference or a bracket run
5 conformance fixtures
598-editorial-markup-closes-outside-a-cross-reference-or-a-bracket-run598-editorial-markup-closes-outside-a-cross-reference-or-a-bracket-run-2598-editorial-markup-closes-outside-a-cross-reference-or-a-bracket-run-3598-editorial-markup-closes-outside-a-cross-reference-or-a-bracket-run-4598-editorial-markup-closes-outside-a-cross-reference-or-a-bracket-run-5
PART 8 resolves a cross-reference and a bracket run before editorial markup, so an insertion or deletion closer inside one is content, and the editorial span closes at the next closer outside it (PART 9 §9 E2b). A substitution's closer and arrow are found the same way: an arrow inside a bracket run or at the end of a cross-reference is content, so the pair is a strikethrough.
{+a </#x+}> b+}<p><ins>a </#x+}> b</ins></p>{+a [x+}](u) b+}<p><ins>a <a href="u">x+}</a> b</ins></p>{-a [x](u-}) b-}<p><del>a <a href="u-}">x</a> b</del></p>{~a [x~>y](u) b~}<p><s>a <a href="u">x~>y</a> b</s></p>{~a </#x~>y> b~}<p><s>a </#x~>y> b</s></p>An autolink is opaque to the bracket scan
3 conformance fixtures
The bracket scan skips an autolink whole (CARVE-P3-001), so a ] inside one cannot close a label opened before it: the link keeps the autolink as text. An email address cannot hold a ], so its row pins the plain case. A < that opens no autolink is no boundary, and its ] closes the label.
[a <https://x]> b](u)<p><a href="u">a https://x] b</a></p>[a <me@x.org> b](u)<p><a href="u">a me@x.org b</a></p>[a <x]> b](u)<p>[a <x]> b](u)</p>An autolink, a cross-reference or a comment is atomic to every outside delimiter
14 conformance fixtures
605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-2605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-3605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-4605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-5605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-6605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-7605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-8605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-9605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-10605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-11605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-12605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-13605-an-autolink-a-cross-reference-or-a-comment-is-atomic-to-every-outside-delimiter-14
An autolink, a cross-reference and a comment are atomic (PART 9 §9 E2a): no delimiter, closer, substitution arrow or bracket outside one reads inside it. A ~> that ends an autolink or a cross-reference supplies no arrow, so the pair is a strikethrough unless a later arrow stands outside them; an address cannot end in ~, so <me@x.org~ is no autolink and its arrow splits. An editorial or delimited comment hides an insertion or deletion closer. A comment opened first is the outer construct, and its own first closer ends it. The bracket scan skips a cross-reference and a delimited comment the way it skips an autolink (CARVE-P3-001), so each label below closes at its last ].
{~a <https://x~>y> b~}<p><s>a <a href="https://x~">https://x~</a>y> b</s></p>{~a <https://x~>y~>z b~}<p><del>a <a href="https://x~">https://x~</a>y</del><ins>z b</ins></p>{~a </#x~> b~}<p><s>a </#x~> b</s></p>{~a <me@x.org~>y> b~}<p><del>a <me@x.org</del><ins>y> b</ins></p>{+a {#x+}#} b+}<p><ins>a <span class="critic-comment">x+}</span> b</ins></p>{-a {#x-}#} b-}<p><del>a <span class="critic-comment">x-}</span> b</del></p>{+a {%x+}%} b+}<p><ins>a b</ins></p>{#a </#x#}> b#}<p><span class="critic-comment">a </#x</span>> b#}</p>[a </#x]> b](u)<p><a href="u">a </#x]> b</a></p>[a </#x]> b]{.c}<p><span class="c">a </#x]> b</span></p>![a </#x]> b](u)<img src="u" alt="a </#x]> b">[a </#x](u)> b](v)<p><a href="v">a </#x](u)> b</a></p>[a {%x]%} b](u)<p><a href="u">a b</a></p>^[a </#x]> b]<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>a </#x]> b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>An escaped cross-reference spelling stays literal
1 conformance fixture
Escaping the opening < keeps the complete </#id> spelling as text. The #id inside it does not become a tag.
\</#id>
x \</#x~>y> y<p></#id></p>
<p>x </#x~>y> y</p>A delimiter that is part of a larger character is text
16 conformance fixtures
600-a-delimiter-that-is-part-of-a-larger-character-is-text600-a-delimiter-that-is-part-of-a-larger-character-is-text-2600-a-delimiter-that-is-part-of-a-larger-character-is-text-3600-a-delimiter-that-is-part-of-a-larger-character-is-text-4600-a-delimiter-that-is-part-of-a-larger-character-is-text-5600-a-delimiter-that-is-part-of-a-larger-character-is-text-6600-a-delimiter-that-is-part-of-a-larger-character-is-text-7600-a-delimiter-that-is-part-of-a-larger-character-is-text-8600-a-delimiter-that-is-part-of-a-larger-character-is-text-9600-a-delimiter-that-is-part-of-a-larger-character-is-text-10600-a-delimiter-that-is-part-of-a-larger-character-is-text-11600-a-delimiter-that-is-part-of-a-larger-character-is-text-12600-a-delimiter-that-is-part-of-a-larger-character-is-text-13600-a-delimiter-that-is-part-of-a-larger-character-is-text-14600-a-delimiter-that-is-part-of-a-larger-character-is-text-15600-a-delimiter-that-is-part-of-a-larger-character-is-text-16
A delimiter counts only when it is a whole grapheme (CARVE-P3-025). Followed by a combining mark (general category Mn, Mc or Me), a variation selector (U+FE00 to U+FE0F) or U+200D ZERO WIDTH JOINER, it is part of a larger character and neither opens nor closes. The keycap emoji * U+FE0F U+20E3 is the case that raised it: the rows show it as an opener and as a closer. A combining acute (U+0301) after a closer, a text-style variation selector (U+FE0E) after an opener and a ZWJ after a closer follow, each with a later delimiter that still pairs across the skipped one. Ordinary spans next to a keycap still form. The guard also covers the opener of a forced span and the * of the combined /* token. The last three rows pin a spacing mark (U+093E, category Mc) after an opener, and {^ before U+20E3 and {, before U+FE0E: every forced opener takes the guard, superscript and subscript included. The editorial and comment frames take it too, one row each: {+ before U+20E3, {- before U+FE0E, a substitution {~ before U+0301, an editorial comment opened by the keycap # U+FE0F U+20E3, and a braced comment {% before U+093E. Each row holds a later frame of the same kind that still forms.
*️⃣abc*<p>*️⃣abc*</p>*a*️⃣<p>*a*️⃣</p>*a*́ b*<p><strong>a*́ b</strong></p>_︎x _y_<p>_︎x <u>y</u></p>~a~b~<p><s>a~b</s></p>*x* *️⃣ *y*<p><strong>x</strong> *️⃣ <strong>y</strong></p>{*️⃣abc*}<p>{*️⃣abc*}</p>/*️a*/<p><em>*️a*</em></p>*ाx *y*<p>*ाx <strong>y</strong></p>{^⃣x^}<p>{^⃣x^}</p>{,︎x,}<p>{,︎x,}</p>{+⃣x+} {+y+}<p>{+⃣x+} <ins>y</ins></p>{-︎x-} {-y-}<p>{-︎x-} <del>y</del></p>{~́a~>b~} {~c~>d~}<p>{~́a~>b~} <del>c</del><ins>d</ins></p>{#️⃣ x#} {#y#}<p>{#️⃣ x#} <span class="critic-comment">y</span></p>a{% y %}b {%ाx%}<p>ab {%ाx%}</p>A tag inside a literal brace run is still a tag
1 conformance fixture
A trailing {…} on a heading is not an attribute list - Carve is djot-strict, so the braces are inline content (§15 A7). Their CONTENTS are inline content too, which is where #word is a tag (§19). Both rules apply at once: the braces stay as typed and the tag inside them renders.
# H {#id .cls}<section id="H-id-cls">
<h1>H {<span class="tag"><strong>#id</strong></span> .cls}</h1>
</section>A math span's base class keeps the class slot in place
2 conformance fixtures
math inline is a mandatory base class, so it is prepended INSIDE the class slot and the slot stays at the first-appearance position of a class in the author's order (PART 10 §1). An id written before any class is still serialized first.
markup-carve/carve#1168 pinned this for the generic ext-NAME fallback. The math span carries a base class the same way and was missed, because no case put an id before a class on it (markup-carve/carve#1164).
$`E=mc^2`{#i .c k=v}<p><span id="i" class="math inline c" k="v" role="math">\(E=mc^2\)</span></p>With no authored class there is no slot to keep, so the base class leads.
$`E=mc^2`{#i k=v}<p><span class="math inline" id="i" k="v" role="math">\(E=mc^2\)</span></p>A marker glued to a name opens nothing
3 conformance fixtures
The boundary rule has a right half. A # or @ written directly against the end of a tag or mention name is preceded by a WORD character - the last character of that name - so it cannot open a second one, exactly as a#b cannot open one (PART 9 §7).
The word production absorbs a glued marker between two word characters, which is that rule stated structurally, but a run that STARTS with a marker never enters word at all - so this shape was unreachable until markup-carve/carve-js#1029 made {#i#j} literal text rather than an attribute block, and the executable spec read it as two tags (markup-carve/carve#1156).
#i#j<p><span class="tag"><strong>#i</strong></span>#j</p>A mention takes the same guard.
@a@b<p><span class="mention"><strong>@a</strong></span>@b</p>Separated by a space, both open normally - that is the control the guard must not break.
#a #b<p><span class="tag"><strong>#a</strong></span> <span class="tag"><strong>#b</strong></span></p>An angle bracket is escaped only where it opens markup
1 conformance fixture
PART 11 §8a M1e. On the Markdown target a < is escaped with a backslash when the next character is an ASCII letter, /, ! or ? - the four things that can open raw HTML - and left alone otherwise. A > takes nothing: mid-line it is inert, and at the start of a line it is a block quote marker M1 already covers.
Escaping the < alone is sufficient, because a tag that cannot open cannot be closed. Every engine used to rewrite both brackets to entities, unconditionally and with no clause behind it (markup-carve/carve#1148); an entity is not an escape, since it replaces the character rather than protecting it.
a < b and a <b> c and x > y<p>a < b and a <b> c and x > y</p>An underscore pair in text is escaped where the line would pair it
1 conformance fixture
PART 11 §8a M1b. On the Markdown target a literal _ is escaped when another live _ on the emitted line could close the emphasis it could open. A run that flanks on both sides can neither open nor close, so company_id stays bare, and so does an underscore no second one can pair with.
Adjacency alone missed this: both underscores of _y_ are text, neither stands beside a delimiter, and every reader turned the author's text into emphasis (markup-carve/carve-js#1716).
/x/_y_ in company_id and a_b_c and a _ b _ c<p><em>x</em>_y_ in company_id and a_b_c and a _ b _ c</p>An underscore pair split across a line break is escaped
1 conformance fixture
PART 11 §8a M1b. The underscore's pair condition reads the whole inline content of the block, because a Markdown reader pairs emphasis across a line break inside a paragraph.
/x/_y
z_ w<p><em>x</em>_y
z_ w</p>The round-trip comparison normalizes a named list
2 conformance fixtures
PART 11 §10k. A round trip preserves meaning, not one serialization, so two renderings compare equal when they differ only by a NAMED entry: <del> and <s> are one tag, and a nested emphasis of different strengths whose child spans the whole parent may commute.
The list is closed. Equal strengths are not on it, because an emphasis inside an emphasis and a single strong are different documents.
{~ ~}<p><s> </s></p>/*x*/<p><strong><em>x</em></strong></p>Braced emphasis can nest its own kind
13 conformance fixtures
471-braced-emphasis-can-nest-its-own-kind471-braced-emphasis-can-nest-its-own-kind-2471-braced-emphasis-can-nest-its-own-kind-3471-braced-emphasis-can-nest-its-own-kind-4471-braced-emphasis-can-nest-its-own-kind-5471-braced-emphasis-can-nest-its-own-kind-6471-braced-emphasis-can-nest-its-own-kind-7471-braced-emphasis-can-nest-its-own-kind-8471-braced-emphasis-can-nest-its-own-kind-9471-braced-emphasis-can-nest-its-own-kind-10471-braced-emphasis-can-nest-its-own-kind-11471-braced-emphasis-can-nest-its-own-kind-12471-braced-emphasis-can-nest-its-own-kind-13
PART 9 §9 E3. Braced emphasis can nest another braced span of the same kind. A bare delimiter of an already open kind remains content within that scope.
a{*{*x*}*}b<p>a<strong><strong>x</strong></strong>b</p>*a {*b*} c*<p><strong>a <strong>b</strong> c</strong></p>{*a *b* c*}<p><strong>a *b* c</strong></p>{/a *b {/c/}*/}<p><em>a <strong>b <em>c</em></strong></em></p>A braced span of another kind starts its own scope, so an opener of the outer kind nests inside it, and a closer inside it cannot reach the outer span. The bare outer span behaves the same way.
{*a {/b {*c*} d/} e*}<p><strong>a <em>b <strong>c</strong> d</em> e</strong></p>{*a {/b *} d/} e*}<p><strong>a <em>b *} d</em> e</strong></p>*a {/b *c* d/} e*<p><strong>a <em>b <strong>c</strong> d</em> e</strong></p>A lone delimiter of the span's own kind is content, whether it touches the opener or stands apart from it, so the pair opens either way.
{==h==}
{//x//}
{= =h= =}
{/ /x/ /}<p><mark>=h=</mark></p>
<p><em>/x/</em></p>
<p><mark> =h= </mark></p>
<p><em> /x/ </em></p>An empty braced pair is literal text. Its two marks cannot overlap, so the three-character spelling has an opener and no closer, and the four-character spelling has both and no content.
{**}
{*}<p>{**}</p>
<p>{*}</p>An empty pair forms no span, and its characters are read like any others (markup-carve/carve#3973). Inside a parent of the same kind its second mark is that parent's closer.
{*a {**} b*}<p><strong>a {*</strong> b*}</p>Escaping the brace stops the opener and nothing else: the inner marks stay active and pair as ordinary emphasis. Keeping the whole span literal takes an escape on every active mark.
\{*x*}
\{\*x\*\}<p>{<strong>x</strong>}</p>
<p>{*x*}</p>A closer that was discarded by a matched child is not retried against an ancestor. It resolves as an ordinary bare mark followed by a literal brace, which leaves the outer opener literal.
{~a {*x ~>y~} z*}<p>{~a <strong>x <s>>y</s>} z</strong></p>A combined token activates two kinds at once, and E3 treats both as ordinary active kinds, so a braced child of either nests inside it.
/*a {*b*} c*/ x
/*a {/b/} c*/ x<p><strong><em>a <strong>b</strong> c</em></strong> x</p>
<p><strong><em>a <em>b</em> c</em></strong> x</p>An escaped hash keeps its escape at a container's content position
2 conformance fixtures
PART 11 §8b M2b is decided on the EMITTED LINE, so a container prefix is passed over before the position is read. A hash at the start of a block quote's or a list item's content opens an ATX heading exactly as one at column 0 does, and its escape is kept there. All three engines dropped it, and a round trip through the Markdown target turned the author's text into a heading (markup-carve/carve#1330).
The narrowing itself does not move, which is the half a correction here is most likely to lose. A hash the prefix does not put at the content position is still emitted bare, and so is one that stands there but opens no heading, since M2b's reading is CommonMark's and a run closed by a letter is not a heading. This pair carries both directions.
> \# heading
>
> C\# is a language
- \# heading
- \#tag rest<blockquote>
<p># heading</p>
<p>C# is a language</p>
</blockquote>
<ul>
<li># heading</li>
<li>#tag rest</li>
</ul>Nesting needs no rule of its own: the prefix is whatever the writer emitted, > > included. Neither does lazy continuation, which is a parser concept - this writer re-prefixes every line of a container, so the last line below is emitted with its > and read at the content position like any other.
> > \# deep
> a
\# heading<blockquote>
<blockquote><p># deep</p></blockquote>
</blockquote>
<blockquote><p>a
# heading</p></blockquote>An unclosed inline literal reaches the end of its block
3 conformance fixtures
The ! prefix changes the node kind whether or not the verbatim run closes. Like an ordinary code or math span, an unclosed literal consumes through the end of its containing block and drops trailing whitespace from its content.
!`unclosed<p>unclosed</p>The same extent applies across a line-block boundary.
::: |
a !`b
c d
:::<div class="line-block">
<p>a b
c d</p>
</div>A table row is its own block boundary. Its closing pipe is not content, while an interior pipe remains part of the unclosed literal.
| a !`b | c d |<table>
<tbody>
<tr><td>a b | c d</td></tr>
</tbody>
</table>A hyphen run opening a word after whitespace is a flag
2 conformance fixtures
PART 9 §8 does not convert a hyphen run that is PRECEDED by whitespace (or the start of the content) and FOLLOWED by a non-whitespace character. That shape is a long CLI flag, and converting it mangled ordinary technical prose silently and in the rendered output only - the author saw git log --oneline in the source and the reader got a command that does not run (markup-carve/carve#1443).
The rule is deliberately narrow. Every canonical dash use is unspaced on at least the left, so requiring whitespace on both sides would have removed the feature along with the damage, and requiring the two sides to match in kind would have broken a---- b----- c------, which the corpus already pins.
git log --oneline and --force-with-lease stay literal.
But pages 1--10, the Mon--Fri window, a---- b----- and a -- b all convert.<p>git log --oneline and --force-with-lease stay literal.</p>
<p>But pages 1–10, the Mon–Fri window, a–– b—– and a – b all convert.</p>An HTML comment is worth pinning rather than leaving to be discovered, because neither half survives and each is lost to a different rule. The opening <!-- is preceded by !, so the flag rule does not reach it and it converts to a dash. The closing --> was flag-shaped and literal until the arrow set took the doubled run (markup-carve/carve#1442); it is now an arrow.
Ruled deliberately rather than papered over. Guarding --> for this one context would put a context-sensitive exception into a set whose argument is that it has none, and Carve escapes raw HTML by default, so a literal HTML comment in prose is already a document about HTML rather than HTML.
<!-- a comment --><p><!– a comment →</p>A hyphen run at the start of a span is a flag
3 conformance fixtures
The start of an inline span's content is the start of the inline content (CARVE-P3-023), so a hyphen run there followed by a non-whitespace character stays literal under CARVE-P3-021, whatever the span's opener is (markup-carve/carve#4170).
a *--x* b, a /--x/ b, a _---x_ b and a */--x/* b<p>a <strong>--x</strong> b, a <em>--x</em> b, a <u>---x</u> b and a <strong><em>--x</em></strong> b</p>A braced span's content starts after its {X opener.
a {*--x*} b and a {=---x=} b<p>a <strong>--x</strong> b and a <mark>---x</mark> b</p>A run followed by a space, a run inside a word, and a run after a * that opens nothing still convert.
a *-- x* b, a *x--y* b and 2*--x<p>a <strong>– x</strong> b, a <strong>x–y</strong> b and 2*–x</p>A braced hyphen pair is an en dash
2 conformance fixtures
The flanking rule above refuses a hyphen run that has whitespace before it and a non-whitespace character after it, which is the shape every long CLI flag has. It is also a shape an author sometimes means as a dash, and there was no way to say so. {--} is that way: it renders a single en dash and the braces are consumed (markup-carve/carve#1447).
The bare run is flag-shaped and stays literal: a ---(p) b.
The braced form converts wherever it stands: a {--}(p) b, x{--}y, {--}start.<p>The bare run is flag-shaped and stays literal: a ---(p) b.</p>
<p>The braced form converts wherever it stands: a –(p) b, x–y, –start.</p>The spelling was an empty deletion, and it cost nothing to take: {--} is a {- opener meeting its -} closer with nothing between them, and the production never permitted that - its content slot is a one-or-more repetition. Exactly one string moves. A deletion that holds a hyphen, or any other content, is untouched.
{---} and {-x-} still delete.<p><del>-</del> and <del>x</del> still delete.</p>There is no braced em dash. {---} deletes a hyphen, which is a thing an author writes, so a tight em dash - the Spanish, French and Russian dialogue convention
- is still written as the literal character.
An empty brace pair is not a construct
2 conformance fixtures
An opener that meets its own closer with nothing between them opened nothing, and its characters are text. Every forced span and every editorial form carries the same one-or-more content slot, so {//}, {**}, {__}, {~~}, {^^}, {,,}, {==}, {++} and {##} all render literally (markup-carve/carve#1447).
Empty pairs are text: {//} {**} {__} {~~} {^^} {,,} {==} {++} {##}.
A pair that holds something is the construct: {/i/} {*b*} {~s~} {+ins+} {# c #}.<p>Empty pairs are text: {//} {**} {__} {~~} {^^} {,,} {==} {++} {##}.</p>
<p>A pair that holds something is the construct: <em>i</em> <strong>b</strong> <s>s</s> <ins>ins</ins> <span class="critic-comment"> c </span>.</p>The rule was already written twice - the productions spell every content slot as one-or-more, and the ambiguities guide says {^^} is not a superscript - and carve-js and carve-rs already read it that way. What the empty forms did was worse than render nothing useful: the author's braces disappeared from the output while staying in the source, which is the same silent loss the hyphen flanking rule above refuses.
A fully empty substitution is the one form left alone. Its two halves are independent, and a half-empty substitution is an ordinary edit - a deletion with no replacement, or an insertion replacing nothing - so it needs its own decision.
{~a~>~} deletes, {~~>b~} inserts, and {~~>~} still does both to nothing.<p><del>a</del><ins></ins> deletes, <del></del><ins>b</ins> inserts, and <del></del><ins></ins> still does both to nothing.</p>A leading escaped caret keeps its escape
1 conformance fixture
PART 11 §5's unconditional caret reaches the LEADING position and stops there (§10g). Here the escape is load-bearing under §2's own test: drop it and the image is promoted to a figure with the line as its caption, so the writer emits it back unchanged. This is the shape the empty caret pair (category 388) must not be read as reaching - there the caret leads nothing, dropping the escape re-derives the same document, and the bare form is canonical.

\^ not a caption<p><img src="b.png" alt="a">
^ not a caption</p>An idle escape does not spread from the block that needed one
1 conformance fixture
The canonical writer escapes a character IF AND ONLY IF omitting the escape would change the re-parsed document (PART 11 §2). Where it cannot decide an occurrence exactly it may fall back to the conservative form, and PART 11 §2b bounds how far that fallback reaches: the SMALLEST unit whose minimal form fails to re-parse, which is the inline run or the block holding it, never the whole document.
The first paragraph below is indented, so its text is ## H and not a heading. Written back at column zero it WOULD be a heading, so that block escalates and comes back as \#\# H. The second paragraph needs nothing: plain (b) text re-parses as itself, and its parentheses stay bare.
Both spellings render the HTML below and re-parse to the same tree, so the .fmt sidecar beside this pair - not the HTML - is what measures the scope.
## H
plain (b) text<section id="H">
<h2>H</h2>
<p>plain (b) text</p>
</section>An idle escape does not spread from the occurrence that needed one
1 conformance fixture
PART 11 §2 escapes a character IF AND ONLY IF omitting the escape would change the re-parsed document, and it takes that decision per OPENER OCCURRENCE. PART 11 §2b bounds how far the conservative fallback REACHES - the smallest unit whose minimal form fails, never the whole document - and corpus 396 pins that bound. It does not make the unit itself finer, and this pair is the half it leaves: WHICH occurrences inside a unit that did escalate carry a backslash.
The paragraph below is indented, so its text is {.note} and not a block attribute. Written back at column zero the first line WOULD open one, so the { is load bearing and comes back escaped. The . and the } beside it are not: neither opens anything at that position, and \{.note} re-parses as the paragraph the author wrote. So does the . ending the second line.
The unit-scoped fallback wrote \{\.note\} here - one knob per unit, so a unit that failed was written conservatively in full and every candidate in it was escaped beside the one that needed it. That spelling renders the HTML below and re-parses to the same tree, so the .fmt sidecar beside this pair - not the HTML - is what measures the occurrence.
{.note}
This paragraph.<p class="note">This paragraph.</p>A boolean attribute does not start with an underscore
4 conformance fixtures
An identifier may start with _, so {_x_} was two constructs at once: the boolean attribute _x_, and a forced underline. Alone on a line the attribute reading won, the underline was unreachable, and with no block beneath it to attach to the line rendered nothing at all - five characters kept in the source and gone from the output. The bare attribute form gives the collision up (markup-carve/carve#1450).
{_x_}
{_x_} y<p><u>x</u></p>
<p><u>x</u> y</p>Only the bare form is narrowed. An id, a class and a key/value keep their leading underscore, and none of them can be read as an underline, because none of them ends _}. HTML has no boolean attribute starting with _, and the one underscore attribute in the wild is hyperscript's, which carries a value.
{#_id ._c _k=1 _="on click"}
para<p id="_id" class="_c" _k="1" _="on click">para</p>A bare {_foo} has no underline reading either, so it is text rather than something else.
{_foo}
para<p>{_foo}
para</p>The writer follows, and nothing extra pins it. PART 11 §6c shortens an empty-string attribute to its bare name, and it cannot do that here - {_u=""} written as {_u} would be text, and {_x_=""} would be an underline, either way a document that no longer says what it said. §1's parse(fmt(x)) == parse(x) is gated across all three engines over this corpus, so the case below breaks each engine's own round-trip on the day it ships the reading rule and not before.
[x]{_u=""}<p><span _u="">x</span></p>Substitution content is inline, and only a top-level arrow splits it
2 conformance fixtures
A {~ … ~} pair is a substitution when it holds a top-level ~>. The search skips verbatim content, so an arrow inside a code span, math, an inline literal or a comment does not split the pair, and neither does an escaped one. A pair with no top-level arrow is a forced strikethrough (markup-carve/carve#2083). An unclosed run takes the rest of the block, so {~`a~>b~} has no closer at all (markup-carve/carve#3973).
{~`a~>b~}
{~a `x~>y` b~}
{~/old/~>/new/~}
{~a\~>b~}<p>{~<code>a~>b~}</code></p>
<p><s>a <code>x~>y</code> b</s></p>
<p><del><em>old</em></del><ins><em>new</em></ins></p>
<p><s>a~>b</s></p>Math, an inline literal and an editorial comment are skipped the same way.
{~$`a~>b`~>c~}
{~!`a~>b`~>c~}
{~a{# ~> #}b~>c~}<p><del><span class="math inline" role="math">\(a~>b\)</span></del><ins>c</ins></p>
<p><del>a~>b</del><ins>c</ins></p>
<p><del>a<span class="critic-comment"> ~> </span>b</del><ins>c</ins></p>Emphasis
8 conformance fixtures
The word-boundary rule applies to every bare delimiter (/ * _ ~ = — all single-char). No bare delimiter emphasizes intraword: foo*bar*baz, foo~bar~baz, snake_case, a/b/c, x = 5, key=value all stay literal. For deliberate intraword emphasis, use the forced {X … X} family (below). Superscript and subscript have no bare delimiter at all — they exist only in the braced forms {^…^} / {,…,} (see below). For any bare delimiter:
- an opener is recognized only if it is not followed by whitespace and is preceded by the start of the line/block, whitespace, or a punctuation character (not by an alphanumeric,
_, or the same delimiter) — soa/b/c,foo_bar_baz,snake_case, and//a/stay literal, while(/x/)anda./b/open after punctuation; - a closer is recognized only if it is not preceded by whitespace and not followed by an alphanumeric character — so
x /a/b ystays literal.
Highlight is the single-char = delimiter; the uniform word boundary keeps x = 5, key=value, a=b literal. Every bare delimiter is single-char, so a doubled delimiter (==x==) is literal by the same-delimiter-adjacency rule, just like **x** or //x//. This is stricter than Djot, whose _/* rule is purely whitespace-flanking. ^ and , are not bare delimiters — a comma or caret in prose is always literal text (1,2,3, a,b,c, x, y, z, 2 ^ 3), and superscript/subscript are written with the braced forms only. /usr/local/ renders as written, <p>/usr/local/</p>: a bare span whose content holds its own delimiter between two word characters does not form, so both slashes stay text. The normative rule lives in resources/grammar.ebnf PART 9 §9 and §22.
foo*bar*baz and a/b/c stay literal.<p>foo*bar*baz and a/b/c stay literal.</p>An opener without a matching closer is left as a literal character.
/foo bar<p>/foo bar</p>A bare / span whose content holds a / between two word characters does not form, so a path with two or more segments stays text. A single segment such as /etc/ is still italic, and {/a/b/} is the form for a slash inside italic text.
/usr/local/<p>/usr/local/</p>Whitespace immediately after an opener (or before a closer) blocks emphasis — the delimiter renders literally.
/ not emphasis /<p>/ not emphasis /</p>An opener may follow punctuation, not only whitespace or the line start.
(/x/) and a./b/<p>(<em>x</em>) and a.<em>b</em></p>A closer is rejected when followed by an alphanumeric character, so an interrupted path stays literal.
x /a/b y<p>x /a/b y</p>No bare delimiter produces intraword emphasis — * behaves like / and _.
foo_bar_baz and snake_case stay literal<p>foo_bar_baz and snake_case stay literal</p>An emphasis opener (any bare delimiter) immediately preceded by the same delimiter or by a literal _ is not valid (this does not affect different-delimiter combinations like /*bold italic*/, and a _ that itself opens an underline span does not block a following opener).
//a/ and snake_/case/<p>//a/ and snake_/case/</p>Inline extensions
5 conformance fixtures
The extension name is an identifier, which permits a leading _, so _ is a valid extension name (grammar extension_name).
:_[x]<p><span class="ext-_">x</span></p>An identifier must start with a letter or _, so a digit-first name is not a valid extension. :1[x] stays literal text; :a1[x] (a digit after the first letter) is a valid extension and renders as a generic span.
:1[x]
:a1[x]<p>:1[x]
<span class="ext-a1">x</span></p>The extension_content runs up to the ] at bracket depth zero, so a balanced [...] inside it is content. With an unbalanced [ it falls back to the first unescaped ].
:foo[a [b] c]<p><span class="ext-foo">a [b] c</span></p>The four names core does not reserve - samp, var, cite, dfn - are the SemanticSpan extension's, so a core processor leaves them as ordinary attributes.
[x]{samp} [y]{dfn="a term"}<p><span samp="">x</span> <span dfn="a term">y</span></p>An explicit abbr value takes precedence over automatic abbreviation definitions, avoiding invalid nested <abbr> markup.
*[HTML]: Hyper Text Markup Language
[HTML]{abbr="Custom"}<p><abbr title="Custom">HTML</abbr></p>Smart typography dashes and quotes
34 conformance fixtures
19-smart-typography-dashes-and-quotes-219-smart-typography-dashes-and-quotes-319-smart-typography-dashes-and-quotes-419-smart-typography-dashes-and-quotes-519-smart-typography-dashes-and-quotes-619-smart-typography-dashes-and-quotes-719-smart-typography-dashes-and-quotes-819-smart-typography-dashes-and-quotes-919-smart-typography-dashes-and-quotes-1019-smart-typography-dashes-and-quotes-1119-smart-typography-dashes-and-quotes-1219-smart-typography-dashes-and-quotes-1319-smart-typography-dashes-and-quotes-1419-smart-typography-dashes-and-quotes-1519-smart-typography-dashes-and-quotes-1619-smart-typography-dashes-and-quotes-1719-smart-typography-dashes-and-quotes-1819-smart-typography-dashes-and-quotes-1919-smart-typography-dashes-and-quotes-2019-smart-typography-dashes-and-quotes-2119-smart-typography-dashes-and-quotes-2219-smart-typography-dashes-and-quotes-2319-smart-typography-dashes-and-quotes-2419-smart-typography-dashes-and-quotes-2519-smart-typography-dashes-and-quotes-2619-smart-typography-dashes-and-quotes-2719-smart-typography-dashes-and-quotes-2819-smart-typography-dashes-and-quotes-2919-smart-typography-dashes-and-quotes-3019-smart-typography-dashes-and-quotes-3119-smart-typography-dashes-and-quotes-3219-smart-typography-dashes-and-quotes-3319-smart-typography-dashes-and-quotes-3419-smart-typography-dashes-and-quotes-35
A quote opens (left/opening quote) when it follows start-of-content, whitespace (incl. NBSP and a line break), or one of the opening/operator characters ( [ { = : - – — / or an opening curly quote; otherwise it closes, subject to the dash, elision and single-quote rules below. So a quote right after =, :, -, /, or an opening paren still opens the first quote (grammar smart_quote).
a="b"
:"q"
-"q"
/"q"
("q")<p>a=“b”
:“q”
-“q”
/“q”
(“q”)</p>When a quote does not follow one of those opening contexts it closes instead, so a quote right after a closing bracket (} ) ]), after sentence punctuation (. ,), or mid-word always becomes a right/closing quote. An empty "" opens both marks (the second " follows a ", which is not an opening context, yet there is nothing to its right to close against, so it too renders as an opening quote).
}"q"
)"q"
]"q"
."q"
,"q"
a"b
""<p>}”q”
)”q”
]”q”
.”q”
,”q”
a”b
““</p>The same opening set applies to the single quote '. After (, [, =, :, -, or / a single quote opens (‘); the matching ' then closes (’).
('q')
['q']
='q'
:'q'
-'q'
/'q'<p>(‘q’)
[‘q’]
=‘q’
:‘q’
-‘q’
/‘q’</p>A single quote after { opens too, shown on its own line because a trailing {…} would otherwise be read as an attribute block.
{'q'}<p>{‘q’}</p>A single quote before a digit is an apostrophe (decade elision), so a digit pair becomes apostrophes on both sides; a quote before a letter in an open context opens.
the '70s and '24' and 'word'<p>the ’70s and ’24’ and ‘word’</p>A run of four or more hyphens is allocated into em/en dashes (all em if divisible by 3, all en if by 2, otherwise max em-dashes with an en remainder) — matching djot.
a---- b----- c------<p>a–– b—– c——</p>Longer runs follow the same allocation with no leftover hyphen: seven is one em plus two en, eight is four en, ten is five en, eleven is three em plus one en, and thirteen is three em plus two en.
a------- b-------- c---------- d----------- e-------------<p>a—–– b–––– c––––– d———– e———––</p>The open/close decision reads the character before the quote. A bare emphasis delimiter is not that character - the quote sees the start of the emphasis CONTENT - and nothing at all before a quote opens it. A quote directly after another one follows whichever half that one resolved to, so a nested pair opens and so does an empty pair.
*'q'*
"hello"
"'nested'"
a*'q'*<p><strong>‘q’</strong></p>
<p>“hello”</p>
<p>“‘nested’”</p>
<p>a*’q’*</p>A soft or hard line break counts as whitespace, so a quote that starts a line opens, in a paragraph and inside a container alike. The decade-elision apostrophe keeps its reading there.
He paused, then said
"I will not go," and left.\
'Fine,' she said.
> She said
> "no" twice.
- He said
"no" twice.
Back in the
'90s it was rare.<p>He paused, then said
“I will not go,” and left.<br>
‘Fine,’ she said.</p>
<blockquote><p>She said
“no” twice.</p></blockquote>
<ul>
<li>He said
“no” twice.</li>
</ul>
<p>Back in the
’90s it was rare.</p>A listed elision takes an apostrophe even at the start of the content. A later quoted word still opens and closes normally (CARVE-P3-023).
'tis the season to be 'jolly'<p>’tis the season to be ‘jolly’</p>An interrupted quotation closes after a dash (R1).
"Wait---" he said.<p>“Wait—” he said.</p>A dash before quoted text still introduces an opening quote.
he said---"Go" and replied–"Now".<p>he said—“Go” and replied–“Now”.</p>End-of-content and closing punctuation after a dash close the quote.
end-"
end-".
end-'!<p>end-”</p>
<p>end-”.</p>
<p>end-’!</p>Listed elisions take apostrophes, including a contraction after the word (R2).
'tis 'em 'twasn't<p>’tis ’em ’twasn’t</p>The elision list is case-insensitive and uses the whole letter run.
'TIS 'tisn 'twas 'twasn 'twere 'twill 'twould 'cause 'til 'n 'bout
say 'tissue'<p>’TIS ’tisn ’twas ’twasn ’twere ’twill ’twould ’cause ’til ’n ’bout</p>
<p>say ‘tissue’</p>A quoted elision word keeps its quote pair.
'n' and 'em' and 'tis'<p>‘n’ and ‘em’ and ‘tis’</p>A quote before a digit after the closing mark prevents the quoted-word exception.
'em'2<p>’em’2</p>An elision and a possessive both use apostrophes.
'tis Jane's dog<p>’tis Jane’s dog</p>A single-quoted span contains an elision without opening a nested span (R3).
'I told 'em so,' he said.<p>‘I told ’em so,’ he said.</p>An unlisted inner opener is also an apostrophe while a single-quote span is open.
'I said 'hello there,' she replied.<p>‘I said ’hello there,’ she replied.</p>An unclosed mid-paragraph opener is demoted at the end of the content.
say 'word<p>say ’word</p>An unclosed opener at the start keeps its opening glyph.
'word<p>‘word</p>An unclosed opener directly after an opening double quote keeps its glyph.
"'word<p>“‘word</p>An opener before inline markup is never demoted.
say '*bold* text<p>say ‘<strong>bold</strong> text</p>Possessives and quotes before digits do not close an open single-quote span.
'Jane's '90s dog and 'word'<p>‘Jane’s ’90s dog and ’word’</p>Quote state follows nested inline content in the surrounding block.
'I *said 'hello* there,' she replied.<p>‘I <strong>said ’hello</strong> there,’ she replied.</p>Each block starts with fresh single-quote state.
'one
say 'two'<p>‘one</p>
<p>say ‘two’</p>An inline footnote keeps its own quote state and finalizes it separately.
say ^['note] 'two'<p>say <a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> ‘two’</p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>‘note<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A footnote leaves an already-open surrounding single quote intact.
'one ^[say 'note] 'two'<p>‘one <a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> ’two’</p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>say ’note<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>An empty braced comment is transparent after a dash (R4).
"Wait---{%%}" he said.<p>“Wait—” he said.</p>A quote after a curly opening quote opens too.
“'word'” and ‘"word"’<p>“‘word’” and ‘“word”’</p>Il dit " oui " hier.<p>Il dit “ oui ” hier.</p>a "q"<p>a ”q”</p>A path or URL ending in a slash closes its quote the same way (R1); a slash before quoted text still opens one.
Exclude "\/trunk/app/config/".
see "https://example.org/" here
the 'tmp/' folder, and/"or" too<p>Exclude “/trunk/app/config/”.</p>
<p>see “https://example.org/” here</p>
<p>the ‘tmp/’ folder, and/“or” too</p>Inline code
7 conformance fixtures
An unclosed run is opaque: an emphasis delimiter or link tail after it is verbatim content, so the surrounding construct never closes.
*a ` b*<p>*a <code> b*</code></p>An unclosed run inside a forced span takes the rest of the block too, so the span has no closer and its opener is text (markup-carve/carve#3973).
{~` ~}<p>{~<code> ~}</code></p>The run does not stop at the span's closer, so a link, image or span after it is code as well.
Run {*`make*}[the docs](u).
A {_``x_} here.
A {=`y=}[note]{.k} here.
{+`added+} [n](u)<p>Run {*<code>make*}[the docs](u).</code></p>
<p>A {_<code>x_} here.</code></p>
<p>A {=<code>y=}[note]{.k} here.</code></p>
<p>{+<code>added+} [n](u)</code></p>A backtick that is content of an earlier construct opens no run at all, so it does not stop a link after that construct.
[a]{title="`"} and [n](u)
{% a ` %}[n](u)
[m](u`) and [m](`v) and [n](w)<p><span title="`">a</span> and <a href="u">n</a></p>
<p><a href="u">n</a></p>
<p><a href="u`">m</a> and <a href="`v">m</a> and <a href="w">n</a></p>A run behind a math or literal prefix takes the rest of the block the same way, and a closed literal nests in a forced span like any other construct.
x{*$`a*} here
x{~$$`b~} here
x{/!`c/} here
x{_!`d`_} here<p>x{*<span class="math inline" role="math">\(a*} here\)</span></p>
<p>x{~<span class="math display" role="math">\[b~} here\]</span></p>
<p>x{/c/} here</p>
<p>x<u>d</u> here</p>A run whose equal-length closer sits later in the block is a closed code span, even where a forced or editorial closer falls inside it.
x{*`a*} and `b`
{*x`a*}`*}
x{+`a+} and `b`
{+x`a+}`+}<p>x{*<code>a*} and </code>b<code></code></p>
<p><strong>x<code>a*}</code></strong></p>
<p>x{+<code>a+} and </code>b<code></code></p>
<p><ins>x<code>a+}</code></ins></p>The run takes a line break with the rest of the block. In a line block the break is content and stays.
x{*`a
*}
::: |
x{*`a
*}
:::<p>x{*<code>a
*}</code></p>
<div class="line-block">
<p>x{*<code>a
*}</code></p>
</div>Non-breaking space
1 conformance fixture
The non-breaking space U+00A0 serializes as in text and code-span output. (In a heading id it is kept as the raw byte instead - ids are not entity-encoded; see Heading IDs.)
`a b`<p><code>a b</code></p>Superscript and subscript
1 conformance fixture
A ^ or , outside the braced forms is always literal text — even where a bare delimiter's word-boundary rule would have matched:
typo ,oops, happens and 10^6^ things and x ^2^ y<p>typo ,oops, happens and 10^6^ things and x ^2^ y</p>Symbols
2 conformance fixtures
Boundary and name-shape cases — all of these stay plain text. The colon is glued to a word character in the first two, and _ cannot open a name in the third:
a:b:c and 10:30: meeting, :_x: too.<p>a:b:c and 10:30: meeting, :_x: too.</p>A symbol is recognized before smart typography, so a name made of typographic punctuation is a symbol rather than a substitution: :+-: is the symbol +-, not a ± between colons. The typographic forms still apply wherever no symbol opens — a +- b is a ± b, and word:+-: has no boundary, so its +- is substituted:
Vote :+1: or :-1:. Tolerance :+-: is a symbol, but a +- b and word:+-: are not.<p>Vote :+1: or :-1:. Tolerance :+-: is a symbol, but a ± b and word:±: are not.</p>A partial braced opener before a terminal backslash
1 conformance fixture
A braced opener without its matching closer remains text. The final backslash creates a hard break.
{*}\<p>{*}<br>
</p>An unclosed backtick run still forms math
2 conformance fixtures
Math uses the code span rule, which permits an unclosed backtick run. The empty body is still math.
$`<p><span class="math inline" role="math">\(\)</span></p>$$``<p><span class="math display" role="math">\[\]</span></p>An unresolved symbol leaves a colon before a quote
1 conformance fixture
A symbol without a replacement renders literally. Its final colon makes the following quote open.
:a:"<p>:a:“</p>Quotes open after an unresolved symbol
1 conformance fixture
Without a symbol map, the shortcode emits its literal text. Its final colon puts the following quote in opening context under CARVE-P3-023.
:a:"q"
:long-name:'q'<p>:a:“q”
:long-name:‘q’</p>A non-ASCII letter does not block a bare delimiter
1 conformance fixture
The heading preserves this row's original name. The ruling in carve#4806 supersedes its old assertion: the boundary guard uses Unicode letters and numbers, and a delimiter beside a letter stays literal in any script.
é*x* y and a*x* y
y *x*é and y *x*a<p>é*x* y and a*x* y
y *x*é and y *x*a</p>A lone brace stays inside forced emphasis
2 conformance fixtures
{^}^}<p><sup>}</sup></p>{*}*}<p><strong>}</strong></p>Combined emphasis finds a later nonempty closer
2 conformance fixtures
/**/ /**/<p><strong><em>*/ /*</em></strong></p>/**/
/**/<p><strong><em>*/
/*</em></strong></p>A literal bracket run bounds emphasis like a resolved one
4 conformance fixtures
A span opened outside a bracket run is not reachable inside it, whether the run resolves or stays literal text, so a same-kind pair inside the run nests.
*[*g*] x*<p><strong>[<strong>g</strong>] x</strong></p>_[_g_] x_ and /[/g/] x/<p><u>[<u>g</u>] x</u> and <em>[<em>g</em>] x</em></p>{*a [*g*] x*}<p><strong>a [<strong>g</strong>] x</strong></p>*[*g*](u) x* and *[*g*]{.c} x*<p><strong><a href="u"><strong>g</strong></a> x</strong> and <strong><span class="c"><strong>g</strong></span> x</strong></p>A quote at the start of a span opens
4 conformance fixtures
The start of an inline span's content is start-of-content for quote direction, for every span kind. A quote after a closed span still closes.
x.="q"=<p>x.<mark>“q”</mark></p>x.*"q"* and x./'q'/<p>x.<strong>“q”</strong> and x.<em>‘q’</em></p>x.*/"q"/* and x.{^"q"^}<p>x.<strong><em>“q”</em></strong> and x.<sup>“q”</sup></p>*a*"q" and x="q"<p><strong>a</strong>”q” and x=“q”</p>A nested braced span hides an editorial closer
5 conformance fixtures
An insertion or deletion looks for its closer past a nested matched braced span, as every closer does under E2a. A frame of its own kind is not skipped, because same-kind insertion or deletion does not nest.
{-{_a-}_} b-}<p><del><u>a-}</u> b</del></p>{+x {~a+}~>c~} b+}<p><ins>x <del>a+}</del><ins>c</ins> b</ins></p>{-{+a-}+} b-}<p><del><ins>a-}</ins> b</del></p>{-{-a-}-} b-}<p><del>{-a</del>-} b-}</p>{+{-a+}-} b+}<p><ins><del>a+}</del> b</ins></p>A combined token inside a forced span stops at the span's closer
4 conformance fixtures
A forced span's closer is paired before bare resolution, so a combined /* token inside the span cannot take a character of that closer or close past it.
{*a*/*} b*/<p><strong>a*/</strong> b*/</p>{/a /*b/} c*/<p><em>a /*b</em> c*/</p>{_x /*a {_b_} c*/ y_}<p><u>x <strong><em>a <u>b</u> c</em></strong> y</u></p>/*{*a*/*} b*/<p><strong><em><strong>a*/</strong> b</em></strong></p>An attribute block after a span behind a guarding opener belongs to that span
2 conformance fixtures
A _ or / that opens a span that closes is not the character before the next opener, so the inner span opens and its attribute block is part of it. A delimiter inside that block closes nothing outside it.
/_a_{title="/"} b/<p><em><u title="/">a</u> b</em></p>_*a*{title="_"} b_<p><u><strong title="_">a</strong> b</u></p>An attribute block that attaches to nothing is text from the first pass
5 conformance fixtures
776-an-attribute-block-that-attaches-to-nothing-is-text-from-the-first-pass776-an-attribute-block-that-attaches-to-nothing-is-text-from-the-first-pass-2776-an-attribute-block-that-attaches-to-nothing-is-text-from-the-first-pass-3776-an-attribute-block-that-attaches-to-nothing-is-text-from-the-first-pass-4776-an-attribute-block-that-attaches-to-nothing-is-text-from-the-first-pass-5
A block behind a delimiter that closes nothing attaches in no reading, so it is content before any block whose span a guard might block. Here the _ closes inside {t=c_}, the * after it opens, and *a* takes {t="_"}, whose _ is then out of reach.
_*a*{t="_"} b/{t=c_}<p><u><strong t="_">a</strong> b/{t=c</u>}</p>_*a*{t="_"} //b/{t=c_}<p><u><strong t="_">a</strong> //b/{t=c</u>}</p>/_a_{t="/"} b*{t=c/}<p><em><u t="/">a</u> b*{t=c</em>}</p>_*a*{t="_"} b/{t=c_} b/{t=c_}<p><u><strong t="_">a</strong> b/{t=c</u>} b/{t=c_}</p>_x /*a*/{.q} b/{c_} c_<p><u>x <strong class="q"><em>a</em></strong> b/{c</u>} c_</p>A guard that closes only inside its guarded child's block
2 conformance fixtures
The _ is an open entry where the * stands, so the * opens whether or not the _ closes later (markup-carve/carve#3973). The child closes and its block attaches, so the _ inside the block is opaque and the guard stays text. A later attributed span reads the same way.
_*a*{t="_"}<p>_<strong t="_">a</strong></p>_*a*{t="_"} /a/{t=a_}<p>_<strong t="_">a</strong> <em t="a_">a</em></p>A matched insertion or deletion hides a substitution's closer
4 conformance fixtures
A matched {+ +} or {- -} frame is an E2a boundary, so a ~} or ~> inside it belongs to the frame. The substitution around it looks for its own arrow and closer past the frame.
{~a~>{+b~}+}~}<p><del>a</del><ins><ins>b~}</ins></ins></p>{~a~>{-b~}-}~}<p><del>a</del><ins><del>b~}</del></ins></p>{~{+b~>c+}~>a~}<p><del><ins>b~>c</ins></del><ins>a</ins></p>{~{-b~>c-}~}<p><s><del>b~>c</del></s></p>A footnote label may hold a bracket
2 conformance fixtures
A footnote label is any run of characters other than ] and a line break, and a [^ run is a footnote reference before bracket scanning. So [^[g] is a reference whether or not it resolves, it starts no bracket run, and a delimiter after its ] can close a span opened before it.
/[^[g]/] b/<p><em>[^[g]</em>] b/</p>*[^[g]*] b*<p><strong>[^[g]</strong>] b*</p>A footnote reference bounds an editorial closer scan
3 conformance fixtures
A [^ run is a footnote reference before bracket scanning, so the scan for an insertion's, a deletion's or a substitution's closer does not skip [^[g]+}] as one bracket run. The closer after the reference's ] ends the frame.
{+[^[g]+}] b+}<p><ins>[^[g]</ins>] b+}</p>{-[^[g]-}] b-}<p><del>[^[g]</del>] b-}</p>{~a~>[^[g]~}] b~}<p><del>a</del><ins>[^[g]</ins>] b~}</p>Inside a note a footnote-shaped run is a bracket run
2 conformance fixtures
Footnote recognition is off inside a note (PART 9 SS16), so [^[g]/] there is an ordinary bracketed run. The run closes at its balanced ], and a delimiter inside it pairs inside it.
^[/[^[g]/] b/]<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p><em>[^[g]/] b</em><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>^[{+[^[g]+}] b+}]<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p><ins>[^[g]+}] b</ins><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>Inside a note a nested note opener is a caret and a bracket run
4 conformance fixtures
Footnote recognition is off inside a note (PART 9 SS16), so a nested ^[ is a literal ^ before an ordinary bracketed run. That run takes a link tail, a reference tail or attributes like any other, and a link inside a note keeps its destination even when the note sits in link text, because the note renders in the endnotes.
^[x ^[a](u) b]<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>x ^<a href="u">a</a> b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>^[x ^[a][r] b]
[r]: /v<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>x ^<a href="/v">a</a> b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>^[x ^[a]{.c} b]<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>x ^<span class="c">a</span> b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>[t ^[x [a](u) b]](/w)<p><a href="/w">t <sup id="fnref1">1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>x <a href="u">a</a> b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A block glued to a split combined token or a forced span's own delimiter
5 conformance fixtures
779-a-block-glued-to-a-split-combined-token-or-a-forced-span-s-own-delimiter779-a-block-glued-to-a-split-combined-token-or-a-forced-span-s-own-delimiter-2779-a-block-glued-to-a-split-combined-token-or-a-forced-span-s-own-delimiter-3779-a-block-glued-to-a-split-combined-token-or-a-forced-span-s-own-delimiter-4779-a-block-glued-to-a-split-combined-token-or-a-forced-span-s-own-delimiter-5
A combined /* that cannot open is read as its two delimiters, so a block after its * attaches to the span that * closes (PART 4), even when the block holds the */ the token would have ended at. Inside a forced span the span's own delimiter is literal (PART 9 SS22), so a block after it attaches to nothing, is text, and cannot hide the span's closer.
b *//*{c_}*/<p>b <strong c_="">//</strong>*/</p>//*a*{c_}*/<p>//<strong c_="">a</strong>*/</p>b *///*{t="*/"}<p>b <strong t="*/">///</strong></p>{*x *b*{t=a*}<p><strong>x *b*{t=a</strong></p>{_x _b_{t=a_}<p><u>x _b_{t=a</u></p>A braced opener forms before an enclosing closer takes its block
14 conformance fixtures
780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-2780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-3780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-4780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-5780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-6780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-7780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-8780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-9780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-10780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-11780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-12780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-13780-a-braced-opener-forms-before-an-enclosing-closer-takes-its-block-14
Resolution is one left-to-right pass, so a braced opener inside a bare pair forms first (PART 9 E2a). When its closer sits in an attribute block glued to the bare pair's closer, the outer entry is out of reach from inside the braced span: the bare delimiter closes nothing, its block is text, and the braced closer in it closes the span. The same holds for every bare kind and every braced kind. A block glued to a delimiter that closes nothing is text too, so a braced opener at its brace still forms; a block glued to a closer that does close attaches.
={_a={c_}<p>=<u>a={c</u></p>_{*_{t=a*}<p>_<strong>_{t=a</strong></p>/{^a/{k=b^}<p>/<sup>a/{k=b</sup></p>~{,a~{k=b,}<p>~<sub>a~{k=b</sub></p>*{=a*{k=b=}<p>*<mark>a*{k=b</mark></p>={/a={k=b/}<p>=<em>a={k=b</em></p>_{~a_{k=b~}<p>_<s>a_{k=b</s></p>/{+a/{k=b+}<p>/<ins>a/{k=b</ins></p>~{-a~{k=b-}<p>~<del>a~{k=b</del></p>*{#a*{k=b#}<p>*<span class="critic-comment">a*{k=b</span></p>={_a={c} b_}<p>=<u>a={c} b</u></p>={_a=b_}<p>=<u>a=b</u></p>a*{_k=b_}<p>a*<u>k=b</u></p>*a*{_k=b_}<p><strong _k="b_">a</strong></p>An opener is open where it stands, so a combined token after a guarded star stays split
66 conformance fixtures
781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-2781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-3781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-4781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-5781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-6781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-7781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-8781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-9781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-10781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-11781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-12781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-13781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-14781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-15781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-16781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-17781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-18781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-19781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-20781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-21781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-22781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-23781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-24781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-25781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-26781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-27781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-28781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-29781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-30781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-31781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-32781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-33781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-34781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-35781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-36781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-37781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-38781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-39781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-40781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-41781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-42781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-43781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-44781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-45781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-46781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-47781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-48781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-49781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-50781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-51781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-52781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-53781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-54781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-55781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-56781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-57781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-58781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-59781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-60781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-61781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-62781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-63781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-64781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-65781-an-opener-is-open-where-it-stands-so-a-combined-token-after-a-guarded-star-stays-split-66
An opener counts as open from where it stands, with no lookahead to whether it later closes (PART 9 SS9 E3). In _* followed by /*, the * of _* is open when /* arrives, so the combined token does not open and its / and * are read singly, whether or not that _ closes later.
_*`/`/*{c_}*/<p>_<strong c_=""><code>/</code>/</strong>*/</p>_*`/`/*{t=a*/}*/<p>_<strong t="a*/"><code>/</code>/</strong>*/</p>_*/*a**/<p>_<strong>/*a</strong>*/</p>_*`/`/*a**/<p>_<strong><code>/</code>/*a</strong>*/</p>_*`/`/*{c_}*/_<p><u><strong c_=""><code>/</code>/</strong>*/</u></p>_*`/`/*{c_}_<p><u><strong c_=""><code>/</code>/</strong></u></p>_*`/`/*{c_}<p>_<strong c_=""><code>/</code>/</strong></p>_*`/`/*{t=a*/}*/_<p><u><strong t="a*/"><code>/</code>/</strong>*/</u></p>_*`/`/*{t=a*/}_<p><u><strong t="a*/"><code>/</code>/</strong></u></p>_*`/`/*{t=a*/}<p>_<strong t="a*/"><code>/</code>/</strong></p>_*`/`/*a*/<p>_<strong><code>/</code>/*a</strong>/</p>_*`/`/*a*/_<p><u><strong><code>/</code>/*a</strong>/</u></p>_*`/`/*a_<p><u>*<code>/</code>/*a</u></p>_*`/`/*a<p>_*<code>/</code>/*a</p>_*`/`/*{c}_*/<p><u><strong c=""><code>/</code>/</strong></u>*/</p>_*`/`/*{c}_*/_<p><u><strong c=""><code>/</code>/</strong></u>*/_</p>_*`/`/*{c}__<p><u><strong c=""><code>/</code>/</strong></u>_</p>_*`/`/*{c}_<p><u><strong c=""><code>/</code>/</strong></u></p>_*`a/`/*{c_}*/<p>_<strong c_=""><code>a/</code>/</strong>*/</p>_*`a/`/*{c_}*/_<p><u><strong c_=""><code>a/</code>/</strong>*/</u></p>_*`a/`/*{c_}_<p><u><strong c_=""><code>a/</code>/</strong></u></p>_*`a/`/*{c_}<p>_<strong c_=""><code>a/</code>/</strong></p>_*`a/`/*{t=a*/}*/<p>_<strong t="a*/"><code>a/</code>/</strong>*/</p>_*`a/`/*{t=a*/}*/_<p><u><strong t="a*/"><code>a/</code>/</strong>*/</u></p>_*`a/`/*{t=a*/}_<p><u><strong t="a*/"><code>a/</code>/</strong></u></p>_*`a/`/*{t=a*/}<p>_<strong t="a*/"><code>a/</code>/</strong></p>_*`a/`/*a*/<p>_<strong><code>a/</code>/*a</strong>/</p>_*`a/`/*a*/_<p><u><strong><code>a/</code>/*a</strong>/</u></p>_*`a/`/*a_<p><u>*<code>a/</code>/*a</u></p>_*`a/`/*a<p>_*<code>a/</code>/*a</p>_*`a/`/*{c}_*/<p><u><strong c=""><code>a/</code>/</strong></u>*/</p>_*`a/`/*{c}_*/_<p><u><strong c=""><code>a/</code>/</strong></u>*/_</p>_*`a/`/*{c}__<p><u><strong c=""><code>a/</code>/</strong></u>_</p>_*`a/`/*{c}_<p><u><strong c=""><code>a/</code>/</strong></u></p>_*`//`/*{c_}*/<p>_<strong c_=""><code>//</code>/</strong>*/</p>_*`//`/*{c_}*/_<p><u><strong c_=""><code>//</code>/</strong>*/</u></p>_*`//`/*{c_}_<p><u><strong c_=""><code>//</code>/</strong></u></p>_*`//`/*{c_}<p>_<strong c_=""><code>//</code>/</strong></p>_*`//`/*{t=a*/}*/<p>_<strong t="a*/"><code>//</code>/</strong>*/</p>_*`//`/*{t=a*/}*/_<p><u><strong t="a*/"><code>//</code>/</strong>*/</u></p>_*`//`/*{t=a*/}_<p><u><strong t="a*/"><code>//</code>/</strong></u></p>_*`//`/*{t=a*/}<p>_<strong t="a*/"><code>//</code>/</strong></p>_*`//`/*a*/<p>_<strong><code>//</code>/*a</strong>/</p>_*`//`/*a*/_<p><u><strong><code>//</code>/*a</strong>/</u></p>_*`//`/*a_<p><u>*<code>//</code>/*a</u></p>_*`//`/*a<p>_*<code>//</code>/*a</p>_*`//`/*{c}_*/<p><u><strong c=""><code>//</code>/</strong></u>*/</p>_*`//`/*{c}_*/_<p><u><strong c=""><code>//</code>/</strong></u>*/_</p>_*`//`/*{c}__<p><u><strong c=""><code>//</code>/</strong></u>_</p>_*`//`/*{c}_<p><u><strong c=""><code>//</code>/</strong></u></p>_*`x /`/*{c_}*/<p>_<strong c_=""><code>x /</code>/</strong>*/</p>_*`x /`/*{c_}*/_<p><u><strong c_=""><code>x /</code>/</strong>*/</u></p>_*`x /`/*{c_}_<p><u><strong c_=""><code>x /</code>/</strong></u></p>_*`x /`/*{c_}<p>_<strong c_=""><code>x /</code>/</strong></p>_*`x /`/*{t=a*/}*/<p>_<strong t="a*/"><code>x /</code>/</strong>*/</p>_*`x /`/*{t=a*/}*/_<p><u><strong t="a*/"><code>x /</code>/</strong>*/</u></p>_*`x /`/*{t=a*/}_<p><u><strong t="a*/"><code>x /</code>/</strong></u></p>_*`x /`/*{t=a*/}<p>_<strong t="a*/"><code>x /</code>/</strong></p>_*`x /`/*a*/<p>_<strong><code>x /</code>/*a</strong>/</p>_*`x /`/*a*/_<p><u><strong><code>x /</code>/*a</strong>/</u></p>_*`x /`/*a_<p><u>*<code>x /</code>/*a</u></p>_*`x /`/*a<p>_*<code>x /</code>/*a</p>_*`x /`/*{c}_*/<p><u><strong c=""><code>x /</code>/</strong></u>*/</p>_*`x /`/*{c}_*/_<p><u><strong c=""><code>x /</code>/</strong></u>*/_</p>_*`x /`/*{c}__<p><u><strong c=""><code>x /</code>/</strong></u>_</p>_*`x /`/*{c}_<p><u><strong c=""><code>x /</code>/</strong></u></p>The rest of a split combined token is read again as inline content
3 conformance fixtures
A combined opener that cannot open is two bare candidates, and everything after them, its old closer included, is read like any other inline content (PART 9 SS9 THE COMBINED TOKEN, carve#3952). A later /* ... */ in that rest forms a combined token.
x */*~/**b a*/~<p>x <strong>/</strong><s><strong><em>*b a</em></strong></s></p>x a/*b~/*/*/*/<p>x a/<strong>b~/</strong><strong><em>/</em></strong></p>- x */*~/**b a*/~<ul>
<li>x <strong>/</strong><s><strong><em>*b a</em></strong></s></li>
</ul>A comment inside a split combined token is removed before pairing
8 conformance fixtures
785-a-comment-inside-a-split-combined-token-is-removed-before-pairing785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-2785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-3785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-4785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-5785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-6785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-7785-a-comment-inside-a-split-combined-token-is-removed-before-pairing-8
A %% comment inside a /* ... */ shape ends at the shape's closer token, and the delimiter stack reads the region as if the comment were absent (PART 9 SS9 P1, SS21a, carve#4042). With a bare / or * open, the combined token does not form, and each row renders exactly like the same line with the comment deleted.
/x /*a %% b*/ y<p><em>x /<strong>a</strong></em> y</p>*x /*a %% b*/ y*<p><strong>x /*a</strong>/ y*</p>p /q /*a b %% c d*/ e<p>p <em>q /<strong>a b</strong></em> e</p>/x /*a %% b*/{.c} y<p><em class="c">x /<strong>a</strong></em> y</p>/x
/*a %% b*/ y<p><em>x
/<strong>a</strong></em> y</p>- /x /*a %% b*/ y<ul>
<li><em>x /<strong>a</strong></em> y</li>
</ul>/x /*a %% `b*/ c` d<p><em>x /<strong>a</strong></em> c<code> d</code></p>> /x /*a
> b %% c*/ y<blockquote><p><em>x /<strong>a
b</strong></em> y</p></blockquote>A block glued to a combined closer inside a braced emphasis span
5 conformance fixtures
786-a-block-glued-to-a-combined-closer-inside-a-braced-emphasis-span786-a-block-glued-to-a-combined-closer-inside-a-braced-emphasis-span-2786-a-block-glued-to-a-combined-closer-inside-a-braced-emphasis-span-3786-a-block-glued-to-a-combined-closer-inside-a-braced-emphasis-span-4786-a-block-glued-to-a-combined-closer-inside-a-braced-emphasis-span-5
Inside {/ ... /} the span's own / is literal, but it can still end a combined token's closer */ (PART 9 SS9 THE COMBINED TOKEN). A block glued to that closer attaches to the combined span (R3 ATTACH), as it does inside {* ... *}. Where the token does not form, the block stays text (carve#4072).
{/a /*b*/{.k} c/}<p><em>a <strong class="k"><em>b</em></strong> c</em></p>{/a /*b*/{.k}{#i}/}<p><em>a <strong class="k" id="i"><em>b</em></strong></em></p>*x {/a /*b*/{k="v w"} c/}<p>*x <em>a <strong k="v w"><em>b</em></strong> c</em></p>{*x {/a /*b*/{.k} c/} y*}<p><strong>x <em>a <strong class="k"><em>b</em></strong> c</em> y</strong></p>{/a /*b */{.k} c/}<p><em>a /*b */{.k} c</em></p>A braced opener whose closers the spans inside it take stays text
4 conformance fixtures
A braced opener forms at the first closer of its mark at its level, past the spans that form inside it (PART 9 SS9 LINEAR TIME, carve#3987). When every later X} closes an inner span, the outer opener is text and the inner spans still form.
{*a {*b *} {*a {*b *} {*a {*b *}<p>{*a <strong>b </strong> {*a <strong>b </strong> {*a <strong>b </strong></p>{*a {*b *} c *} {*d {*e *}<p><strong>a <strong>b </strong> c </strong> {*d <strong>e </strong></p>> {/a {/b /} {/c {/d /}<blockquote><p>{/a <em>b </em> {/c <em>d </em></p></blockquote>- {_a {_b _} {_c {_d _}<ul>
<li>{_a <u>b </u> {_c <u>d </u></li>
</ul>A code span, bracket run or arrow inside an inner pair keeps the outer opener text
3 conformance fixtures
A braced opener forms at the first closer of its mark at its level, past the spans that form inside it (PART 9 §9 LINEAR TIME, carve#4098). A closed code span or bracket run inside the inner pair hides no closer, and an arrow does not change which ~} closes a {~, so each outer opener is still text and the inner spans still form.
{*a {*b `c` *} {*a {*b `c` *} {*a {*b `c` *}<p>{*a <strong>b <code>c</code> </strong> {*a <strong>b <code>c</code> </strong> {*a <strong>b <code>c</code> </strong></p>{*a {*b [c] *} {*a {*b [c] *} {*a {*b [c] *}<p>{*a <strong>b [c] </strong> {*a <strong>b [c] </strong> {*a <strong>b [c] </strong></p>{~a ~> {~b ~} {~a ~> {~b ~} {~a ~> {~b ~}<p>{~a ~> <s>b </s> {~a ~> <s>b </s> {~a ~> <s>b </s></p>A mention or tag keeps its full spelling in a strong child
2 conformance fixtures
The inert carrier holds one strong child containing the sigil and the name. The same child structure applies inside other inline content.
@ann #tag<p><span class="mention"><strong>@ann</strong></span> <span class="tag"><strong>#tag</strong></span></p>*hi @ann* and [#tag]{.x}<p><strong>hi <span class="mention"><strong>@ann</strong></span></strong> and <span class="x"><span class="tag"><strong>#tag</strong></span></span></p>A generic extension parses its captured content as inline content
3 conformance fixtures
The generic span renders parsed inline children. An empty captured run renders an empty span.
:code[*b*] :foo[]<p><span class="ext-code"><strong>b</strong></span> <span class="ext-foo"></span></p>:foo[/a *b*/]<p><span class="ext-foo"><em>a <strong>b</strong></em></span></p>> :foo[*b*] and @ann<blockquote><p><span class="ext-foo"><strong>b</strong></span> and <span class="mention"><strong>@ann</strong></span></p></blockquote>The equals of a not-equal sign neither opens nor closes a highlight
4 conformance fixtures
!= is a comparison like <= and >= (PART 9 §9, carve#4177): its = is part of the symbol, so a bare highlight around it keeps the glyph inside, and the comparison alone opens or closes nothing. In !== the != is read first, so the extra = closes the highlight.
=a != b=<p><mark>a ≠ b</mark></p>=a!= b<p>=a≠ b</p>=a != b= and =c=<p><mark>a ≠ b</mark> and <mark>c</mark></p>=a !== b=<p><mark>a ≠</mark> b=</p>A long backtick run or a long run of unclosed brackets renders
2 conformance fixtures
A code span pairs a backtick run with the next run of exactly its length, at any length (PART 3 code_span). An opening [ with no ] after it is literal text however many there are: unmatched brackets do not nest, so no nesting bound applies (PART 9 §25, carve#4134).
a `````````x````````` b<p>a <code>x</code> b</p>[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x<p>[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x</p>A comment marker at the start of editorial content is text
3 conformance fixtures
Insert, delete and substitution content is inline text, and a %% there starts no comment: a comment is a line construct (carve#4178). The content renders as written.
{+%% b+}<p><ins>%% b</ins></p>{-%% b-}<p><del>%% b</del></p>{~%% b~>x~}<p><del>%% b</del><ins>x</ins></p>A hyphen run at the end of a span converts
3 conformance fixtures
A span's closing delimiter is not content, so nothing follows a hyphen run at the end of a span's content, as nothing follows one at the end of a paragraph. The run converts under CARVE-P3-021, whatever the span's closer is (markup-carve/carve#4260).
*a --* b, /a --/ b, _a ---_ b, ~a --~ b and */a --/* b<p><strong>a –</strong> b, <em>a –</em> b, <u>a —</u> b, <s>a –</s> b and <strong><em>a –</em></strong> b</p>A braced span's content ends before its X} closer, and a run after a soft break converts the same way.
{*a --*} b and {=a ---=} b
*a
--* b<p><strong>a –</strong> b and <mark>a —</mark> b
<strong>a
–</strong> b</p>A run followed by a character that is not a closer still stays literal, and so does a run at the start of a span.
(a --) b, *a --x* b and *--x* b<p>(a --) b, <strong>a --x</strong> b and <strong>--x</strong> b</p>An escaped space and a hard break work inside a forced span
2 conformance fixtures
A forced span holds its own delimiter literal (PART 9 §22), and nothing else. An escaped space is still a non-breaking space inside it, and a backslash at the end of a line is still a hard break (PART 3, markup-carve/carve#4266).
{=\ x=}, {_a \ b_} and {*a\
b*}<p><mark> x</mark>, <u>a b</u> and <strong>a<br>
b</strong></p>An escaped delimiter is still literal, so \= does not close the span.
{=a\ =} and {=a\=}<p><mark>a </mark> and {=a=}</p>An escaped space before a comment marker separates it
3 conformance fixtures
An escaped space is a space before %% (CARVE-P9-041), as it is wherever flanking is measured. The %% starts a trailing comment, and the escape keeps its no-break space: it is not part of the separating run the comment consumes (carve#4274).
x\ %% c<p>x </p>The same holds in a forced span, which the comment ends at its closer, and after spaces the comment consumes.
{=a\ %% c=} t and b \ %% d<p><mark>a </mark> t and b </p>The combined token ends the comment at its closer.
/*x\ %% c*/ t<p><strong><em>x </em></strong> t</p>An arrow a highlight closes leaves its rest to read with what follows
4 conformance fixtures
An arrow whose = closes a highlight is gone (PART 9 §9). Its > reads with the next = as the comparison >=, whose = neither opens nor closes.
=a<=>=b=<p><mark>a<</mark>≥b=</p>The same for the doubled arrow.
=a ==>=b=<p><mark>a =</mark>≥b=</p>Without a following = the rest stays text and a later pair forms.
=a<=> =b=<p><mark>a<</mark>> <mark>b</mark></p>Another delimiter after the rest is unaffected.
=a<=>*b*<p><mark>a<</mark>><strong>b</strong></p>A token inside a literal include directive opens nothing
1 conformance fixture
A directive invalid on its face has no inline parse of its tokens (CARVE-P6-001), so its backtick opens no code span and the pair around it forms.
*{{ `@lines:1 }}ter*<p><strong>{{ `@lines:1 }}ter</strong></p>A comment closes only at a closer the author wrote
4 conformance fixtures
A {% with no %} after it is text, whatever unattached block follows it. A comment that renders nothing leaves the quote after it at the position before the comment, and that position is the comment's first {%, not one inside its body (CARVE-P3-023, carve#4317).
{%~{#i}<p>{%~{<span class="tag"><strong>#i</strong></span>}</p>{% ^{#i}*-}{#c#}<p>{% ^<span class="critic-comment">i}*-}{#c</span></p>`{%`^{#i .c}~{#c#}<p><code>{%</code>^<span class="critic-comment">i .c}~{#c</span></p>{%**a*{%z%}"<p>“</p>A quote before a span closer closes
4 conformance fixtures
CARVE-P3-023 R1 reads the next source character after a dash or slash, and a span's closing delimiter is not that character: the quote closes as at the end of a paragraph (carve#4318).
*"Wait-"*<p><strong>“Wait-”</strong></p>_"Wait-"_<p><u>“Wait-”</u></p>{+"Wait-"+}<p><ins>“Wait-”</ins></p>*"Wait/"*<p><strong>“Wait/”</strong></p>A reference link around a literal directive renders
2 conformance fixtures
A directive invalid on its face is emitted as its source text and a link around it may still pair across it (CARVE-P6-001). A reference link is no exception.
[a {{ x @lines:0 }} b][r]
[r]: /r<p><a href="/r">a {{ x @lines:0 }} b</a></p>The rest of the link text reads as usual.
[{{ x @code }} *b*][r] c
[r]: /r<p><a href="/r">{{ x @code }} <strong>b</strong></a> c</p>A marker the left boundary refuses is an ordinary character
3 conformance fixtures
A # or @ glued to a word opens no tag or mention, so no name run exists and what follows is read fresh (carve#4329).
b#-><p>b#-></p>b@-><p>b@-></p>b#--><p>b#→</p>A quote in a bare include token opens no run
1 conformance fixture
PART 6: only a quoted path or a quoted option value holds the closer (carve#4462).
{{ it's_x @lines:0-1 }} it's_y }}<p>{{ it's_x @lines:0-1 }} it’s_y }}</p>A standalone code include with no resolver is literal in every host
3 conformance fixtures
PART 10 I1c and I2 (carve#4463): the line stays literal in a quote as at the top level, and a malformed language is literal inside a paragraph too.
x {{ a @code:a,b }} y<p>x {{ a @code:a,b }} y</p>> {{ a @code:a,b }}<blockquote><p>{{ a @code:a,b }}</p></blockquote>> {{ _a_ @code:js }}<blockquote><p>{{ _a_ @code:js }}</p></blockquote>A code span before a literal directive closes inside it
2 conformance fixtures
A literal directive is no atom (CARVE-P9-043), so a code span opened before it closes at a run inside it, as a delimiter span does.
`a *{{ `@lines:1 }}*<p><code>a *{{ </code><span class="mention"><strong>@lines</strong></span>:1 }}*</p>A code span around the whole directive stays one span.
`{{ a @lines:0 }}`<p><code>{{ a @lines:0 }}</code></p>An email autolink takes every email character in its domain
4 conformance fixtures
email_autolink allows any email_char before the final ., a dot included.
<a@b..c><p><a href="mailto:a@b..c">a@b..c</a></p><a@b+c.d><p><a href="mailto:a@b+c.d">a@b+c.d</a></p>The domain needs a character after the @ and letters after the last dot.
<a@.c><p><a@.c></p><a@b.c1><p><a@b.c1></p>A hard break is whitespace to a typography flank
6 conformance fixtures
856-a-hard-break-is-whitespace-to-a-typography-flank856-a-hard-break-is-whitespace-to-a-typography-flank-2856-a-hard-break-is-whitespace-to-a-typography-flank-3856-a-hard-break-is-whitespace-to-a-typography-flank-4856-a-hard-break-is-whitespace-to-a-typography-flank-5856-a-hard-break-is-whitespace-to-a-typography-flank-6
A quote after a dash closes before a hard break, as it does before a soft break.
"a-"\
b<p>“a-”<br>
b</p>A dash run before a hard break is not a flag.
x --\
y<p>x –<br>
y</p>An escaped space reads the same way, for a dash run and for a quote.
x --\ y<p>x – y</p>"a-"\ b<p>“a-” b</p>A slash closes a quote the same way, and so does a single quote.
'a/'\
b<p>‘a/’<br>
b</p>An escaped backslash is a character, not a break: the quote opens.
"a-"\\ b<p>“a-“\ b</p>An extension's content closes at the first unescaped bracket
3 conformance fixtures
An escaped ] is content.
:foo[a\]b]<p><span class="ext-foo">a]b</span></p>An escaped backslash leaves the bracket unescaped, so it closes.
:foo[a\\]b]<p><span class="ext-foo">a\</span>b]</p>With no unescaped ] there is no extension.
:foo[a\]<p>:foo[a]</p>A note body and an extension's content hold a comment's run
5 conformance fixtures
859-a-note-body-and-an-extension-s-content-hold-a-comment-s-run859-a-note-body-and-an-extension-s-content-hold-a-comment-s-run-2859-a-note-body-and-an-extension-s-content-hold-a-comment-s-run-3859-a-note-body-and-an-extension-s-content-hold-a-comment-s-run-4859-a-note-body-and-an-extension-s-content-hold-a-comment-s-run-5
A %% that starts a note's body is a comment, and it ends at the closing ]. The comment text is never published.
^[%% c] d<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> d</p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p><a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>^[a %% c] d<p><a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a> d</p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>a<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>An extension's content holds a run the same way, and so does a bracket run that stays literal.
:foo[%% c] d<p><span class="ext-foo"></span> d</p>:foo[a %% c] d<p><span class="ext-foo">a</span> d</p>[a %% c] d<p>[a] d</p>A non-core element name and a quote after a closed span
2 conformance fixtures
samp, var, cite and dfn are not core elements, so an inline extension of that name renders as the generic extension span (PART 10, CARVE-P10-008).
:samp[x]<p><span class="ext-samp">x</span></p>The end of a closed inline element counts as a word character, so a quote right after it closes (CARVE-P3-023).
[—]{.c}"q"<p><span class="c">—</span>”q”</p>A literal bracket run is a typography region
4 conformance fixtures
A bracket run that stays literal is a region like a span, so a hyphen run at the start of its content followed by a non-whitespace character stays literal under CARVE-P3-021 (markup-carve/carve#4551).
a [--x] y and a [---x] y<p>a [--x] y and a [---x] y</p>A parenthesis opens no region, but an opening ( after whitespace counts as whitespace for the same test (markup-carve/carve#4813).
a (--x) y<p>a (--x) y</p>At the end of the region nothing follows the run, so it converts as at the end of a span.
[x--] y<p>[x–] y</p>An unbalanced [ is text and opens no region, so the run after it converts.
a [--x y<p>a [–x y</p>An abbreviation expansion is not scanned again
9 conformance fixtures
866-an-abbreviation-expansion-is-not-scanned-again866-an-abbreviation-expansion-is-not-scanned-again-2866-an-abbreviation-expansion-is-not-scanned-again-3866-an-abbreviation-expansion-is-not-scanned-again-4866-an-abbreviation-expansion-is-not-scanned-again-5866-an-abbreviation-expansion-is-not-scanned-again-6866-an-abbreviation-expansion-is-not-scanned-again-7866-an-abbreviation-expansion-is-not-scanned-again-8866-an-abbreviation-expansion-is-not-scanned-again-9
PART 9R R3 (carve#4556). A term matches in rendered text, in one pass. Its expansion, the markup around it, entity names and raw output are not text.
*[A]: x
*[x]: y onmouseover=alert(1) z
A<p><abbr title="x">A</abbr></p>*[A]: x
*[title]: y
A<p><abbr title="x">A</abbr></p>*[A]: B
*[B]: C
*[C]: A
A B C<p><abbr title="B">A</abbr> <abbr title="C">B</abbr> <abbr title="A">C</abbr></p>*[amp]: x
a & amp<p>a & <abbr title="x">amp</abbr></p>*[gt]: x
a > b<p>a > b</p>*[A]: x
```=html
<script>var A=1</script>
```<script>var A=1</script>*[A]: x
`A<b>`{=html} A<p>A<b> <abbr title="x">A</abbr></p>*[A]: x
```=html
<code>
```
A<code>
<p><abbr title="x">A</abbr></p>*[A]: x
```=html
</pre>
```
```
A
```</pre>
<pre><code>A
</code></pre>Brackets nested past the cap stay literal
3 conformance fixtures
PART 9 §25 (carve#4557). A pair past MAX_NESTING_DEPTH degrades to literal text, and the pairs around it keep their meaning.
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]<p>[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]</p>[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]{.a}<p><span class="a">[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]</span></p>- p [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] q<ul>
<li>p [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[x]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] q</li>
</ul>A comment at the start of content counts as nothing for quotes
4 conformance fixtures
A braced comment that opens a paragraph renders nothing, so a quote after it is still at the start of the content and keeps its opening glyph (markup-carve/carve#4552).
{%%}'word<p>‘word</p>{%%}"q"<p>“q”</p>A comment with text, or two in a row, counts as nothing too.
{% c %}{% d %}'word<p>‘word</p>After a word the comment changes nothing: the quote is not at the start.
a {%%}'word<p>a ’word</p>An abbreviation does not match in a mention or an inline literal
5 conformance fixtures
870-an-abbreviation-does-not-match-in-a-mention-or-an-inline-literal870-an-abbreviation-does-not-match-in-a-mention-or-an-inline-literal-2870-an-abbreviation-does-not-match-in-a-mention-or-an-inline-literal-3870-an-abbreviation-does-not-match-in-a-mention-or-an-inline-literal-4870-an-abbreviation-does-not-match-in-a-mention-or-an-inline-literal-5
PART 9R R3 (carve#4560). The text of a code span, an inline literal and a mention is not scanned for abbreviations.
*[A]: x
@A and !`A` and `A`<p><span class="mention"><strong>@A</strong></span> and A and <code>A</code></p>*[A]: x
!`A`{.c} and A<p><span class="c">A</span> and <abbr title="x">A</abbr></p>*[AB]: x
# @AB and !`AB`<section id="AB-and-AB">
<h1><span class="mention"><strong>@AB</strong></span> and AB</h1>
</section>*[A]: x
| @A | !`A B` | A |<table>
<tbody>
<tr><td><span class="mention"><strong>@A</strong></span></td><td>A B</td><td><abbr title="x">A</abbr></td></tr>
</tbody>
</table>*[A]: x
> q !`A`
^ cap @A A<figure>
<blockquote><p>q A</p></blockquote>
<figcaption>cap <span class="mention"><strong>@A</strong></span> <abbr title="x">A</abbr></figcaption>
</figure>An abbreviation boundary uses Unicode letters and numbers
1 conformance fixture
PART 9R R3. A neighbouring Unicode letter or number blocks an abbreviation match on that side. The ASCII-only emphasis guard does not apply.
*[HTML]: Hypertext
αHTMLβ HTML αHTML HTMLβ 2HTML<p>αHTMLβ <abbr title="Hypertext">HTML</abbr> αHTML HTMLβ 2HTML</p>An arrow takes its hyphens from a longer run
1 conformance fixture
PART 3 CARVE-P3-022. An arrow needs its exact run: a hyphen run longer than the arrow's is a dash run, at either end (carve#4645).
a<---b
<---><p>a<—b</p>
<p><—></p>A failed cross-line reference label stays verbatim
1 conformance fixture
PART 3 CARVE-P3-004. A reference label that crosses a line and fails to pair or resolve is emitted as written. Neither the collapsed nor the explicit form rescans its inner markers.
[*x*
y][]
[*x* y]: /u
[*z*
w][missing]<p>[*x*
y][]</p>
<p>[*z*
w][missing]</p>Abbreviations skip generated and link-derived text
1 conformance fixture
PART 9R R3 and R4. An authored heading and ordinary text expand an abbreviation term. A tag handle, an autolink display and a cloned cross-reference label keep their text opaque.
*[A]: expansion
# A
<#A> </#A> <https://example.test/A> A<section id="A">
<h1><abbr title="expansion">A</abbr></h1>
<p><<span class="tag"><strong>#A</strong></span>> <a href="#A">A</a> <a href="https://example.test/A">https://example.test/A</a> <abbr title="expansion">A</abbr></p>
</section>A comment in editorial markup ends at the first raw closer
5 conformance fixtures
889-a-comment-in-editorial-markup-ends-at-the-first-raw-closer889-a-comment-in-editorial-markup-ends-at-the-first-raw-closer-2889-a-comment-in-editorial-markup-ends-at-the-first-raw-closer-3889-a-comment-in-editorial-markup-ends-at-the-first-raw-closer-4889-a-comment-in-editorial-markup-ends-at-the-first-raw-closer-5
A %% comment takes every character after it, so a backtick in it opens no code span. In {+, {- and /* it ends at the first raw closer, as in every other braced form (CARVE-P9-042, carve#4641, carve#4720).
{+a %% `+}` b+} c<p><ins>a</ins><code> b+} c</code></p>{-a %% `-}` b-} c<p><del>a</del><code> b-} c</code></p>/*a %% `*/` b*/ c<p><strong><em>a</em></strong><code> b*/ c</code></p>{+a\ %% `+}` b+} c<p><ins>a </ins><code> b+} c</code></p>{+a `%%` b+} c<p><ins>a <code>%%</code> b</ins> c</p>A comment on the new side of a substitution ends at the first raw closer
3 conformance fixtures
A %% comment after the ~> of a substitution takes every character to the first raw ~}, as on the old side, so a backtick in it opens no code span (CARVE-P9-042, carve#4641, carve#4745).
{~a~>b %% `~}` c~} d<p><del>a</del><ins>b</ins><code> c~} d</code></p>{~a~>b %% x~} d<p><del>a</del><ins>b</ins> d</p>{~a~>b `%%` c~} d<p><del>a</del><ins>b <code>%%</code> c</ins> d</p>Abbreviations skip caption cross-reference text and an unresolved cross-reference
3 conformance fixtures
PART 9R R3 and R4 (carve#4742). The literal an unresolved cross-reference renders is source text and is not scanned for abbreviations.
*[A]: x
</#A><p></#A></p>A numbered caption's cross-reference link text is not scanned either; the caption itself still expands at its authored position.
*[A]: x
{#t}
| a |
^ A #: c
See </#t>.<table id="t">
<caption><abbr title="x">A</abbr> 1: c</caption>
<tbody>
<tr><td>a</td></tr>
</tbody>
</table>
<p>See <a href="#t">A 1</a>.</p>The same holds for a figure caption referenced before it.
*[A]: x
See </#f>.
{#f}

^ A #: c<p>See <a href="#f">A 1</a>.</p>
<figure id="f">
<img src="i.png" alt="i">
<figcaption><abbr title="x">A</abbr> 1: c</figcaption>
</figure>A braced comment after a quote does not change its direction
2 conformance fixtures
PART 3 quote direction R1 (carve#4719). A braced inline comment counts as nothing on either side of a quote, so a comment after a quote that follows a dash leaves the quote closing, as it closes without the comment.
"a-"{%%}<p>“a-”</p>A comment before a space or punctuation reads the same, and a comment before a digit leaves an apostrophe.
"Wait---"{% c %} he said. '{%%}90s<p>“Wait—” he said. ’90s</p>Abbreviations skip an editorial comment and an unresolved symbol
2 conformance fixtures
PART 9R R3 (carve#4801). The text of an editorial comment and the literal a symbol renders when no map resolves it are not scanned for abbreviations.
{#A#} and :A:
*[A]: y<p><span class="critic-comment">A</span> and :A:</p>An attribute block on the symbol does not change that; prose next to it still expands.
:A:{.c} and A
*[A]: y<p><span class="c">:A:</span> and <abbr title="y">A</abbr></p>Unicode letters block bare emphasis
1 conformance fixture
Bare emphasis cannot open or close within Unicode words. The braced form can emphasize text inside a word.
Москва/Питер/Киев
日本/中国/韩国
снейк_кейс_тут
ä/ö/ü
𐐀*x* and *x*𐐁
日本{/中国/}韩国<p>Москва/Питер/Киев
日本/中国/韩国
снейк_кейс_тут
ä/ö/ü
𐐀*x* and *x*𐐁
日本<em>中国</em>韩国</p>A caption number stops no delimiter glued after its placeholder
3 conformance fixtures
CARVE-P2-022 (carve#4886). The number is assigned in the resolution pass, so it takes no part in reading the inline structure around the #: a delimiter right after the placeholder still opens.

^ Figure a#*b*<figure>
<img src="a.png" alt="i">
<figcaption>Figure a1<strong>b</strong></figcaption>
</figure>
^ Figure #=b=<figure>
<img src="a.png" alt="i">
<figcaption>Figure 1<mark>b</mark></figcaption>
</figure>
^ *a*#/b/<figure>
<img src="a.png" alt="i">
<figcaption><strong>a</strong>1<em>b</em></figcaption>
</figure>A name ending in a hyphen leaves the next marker free
2 conformance fixtures
PART 9 §7. A marker written right after a mention or tag name opens nothing when the name ends in a word character (#a#b). A name may end in -, which is no word character, so the next marker opens its own mention or tag, as it does after any other -.
x #a-#b and @a-@b<p>x <span class="tag"><strong>#a-</strong></span><span class="tag"><strong>#b</strong></span> and <span class="mention"><strong>@a-</strong></span><span class="mention"><strong>@b</strong></span></p>A run of hyphens and a mixed sigil read the same way, while a name ending in a letter still holds the marker after it as text.
See #a--#b-#c, #a-@b and #a#b<p>See <span class="tag"><strong>#a--</strong></span><span class="tag"><strong>#b-</strong></span><span class="tag"><strong>#c</strong></span>, <span class="tag"><strong>#a-</strong></span><span class="mention"><strong>@b</strong></span> and <span class="tag"><strong>#a</strong></span>#b</p>A braced comment before a flag opener counts as nothing
2 conformance fixtures
CARVE-P3-021 (carve#4813, carve#4719). An opening (, " or ' at the start of the inline content counts as whitespace for the flag test, and a braced comment in front of it counts as nothing, so the run stays literal as it does without the comment.
{%c%}(--force) y<p>(--force) y</p>A range and a doubled parenthesis still convert.
{%c%}(1--10) and {%c%}((--x))<p>(1–10) and ((–x))</p>A braced comment that starts a continuation line is at block position
4 conformance fixtures
A {% that starts a continuation line of an open paragraph is at block position, so CARVE-P2-035 applies: every later line of the run, the %} closer included, must be indented past the opening {. Otherwise the whole run is literal paragraph text, in the root, a list item and a quote alike (PART 9 §21a, CARVE-P9-042, carve#5189). Indented past the {, the run is a comment and renders nothing.
pre
{% a
b %}<p>pre
{% a
b %}</p>- pre
{% a
b %}<ul>
<li>pre
{% a
b %}</li>
</ul>> pre
> {% a
> b %}<blockquote><p>pre
{% a
b %}</p></blockquote>pre
{% a
b %}<p>pre
</p>A lazy braced comment uses source columns in every host
8 conformance fixtures
960-a-lazy-braced-comment-uses-source-columns-in-every-host960-a-lazy-braced-comment-uses-source-columns-in-every-host-2960-a-lazy-braced-comment-uses-source-columns-in-every-host-3960-a-lazy-braced-comment-uses-source-columns-in-every-host-4960-a-lazy-braced-comment-uses-source-columns-in-every-host-5960-a-lazy-braced-comment-uses-source-columns-in-every-host-6960-a-lazy-braced-comment-uses-source-columns-in-every-host-7960-a-lazy-braced-comment-uses-source-columns-in-every-host-8
A block-position {% run in a container takes no lazy continuation. The refused opener is literal and later lines follow ordinary paragraph rules (CARVE-P2-035, carve#5830).
list, continuation at the opener column.
- pre
{% b
b %}<ul>
<li>pre
{% b
b %}</li>
</ul>list, continuation one source column deeper.
- pre
{% b
b %}<ul>
<li>pre
{% b
b %}</li>
</ul>quote, continuation at the opener column.
> pre
{% b
b %}<blockquote><p>pre
{% b
b %}</p></blockquote>quote, continuation one source column deeper.
> pre
{% b
b %}<blockquote><p>pre
{% b
b %}</p></blockquote>footnote, continuation at the opener column.
[^a]: pre
{% b
b %}
ref[^a]<p>ref<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>pre
{% b
b %}<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>footnote, continuation one source column deeper.
[^a]: pre
{% b
b %}
ref[^a]<p>ref<a id="fnref1" href="#fn1" role="doc-noteref"><sup>1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>pre
{% b
b %}<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>div, continuation at the opener column.
::: note
pre
{% b
b %}
:::<aside class="admonition note" aria-label="Note">
<p>pre
{% b
b %}</p>
</aside>div, continuation one source column deeper.
::: note
pre
{% b
b %}
:::<aside class="admonition note" aria-label="Note">
<p>pre
</p>
</aside>Adjacent invalid includes keep their tokens literal
1 conformance fixture
An invalid @lines directive emits its source without parsing its backtick. That backtick cannot open a code span that breaks the next invalid directive (CARVE-P6-001).
{{ `@lines:1 }}{{ `@lines:1 }}<p>{{ `@lines:1 }}{{ `@lines:1 }}</p>Code attributes keep dollar sequences
1 conformance fixture
A quoted attribute value stays literal when it is attached to a code span (PART 4 quoted_value; carve#5668).
`b`{k="$`"}<p><code k="$`">b</code></p>A literal bracket region cuts an inner attribute
1 conformance fixture
The first ] in the quoted value closes the outer bracket run. Its region boundary cuts the inner link's attribute candidate, which stays text (PART 9 §9; carve#5672).
[t[x](/u){title="]"}y](/z)<p>[t<a href="/u">x</a>{title=“]”}y](/z)</p>Abbreviations test rendered adjacency across inline nodes
2 conformance fixtures
PART 9R R3. A letter next to an abbreviation blocks expansion even when an eligible inline node edge separates them.
[w[HTML](u)]()
*[HTML]: t<p><a href="">wHTML</a></p>w{*HTML*}
*[HTML]: t<p>w<strong>HTML</strong></p>Literal angle brackets in heading reference key
1 conformance fixture
A collapsed reference uses the heading's rendered plain text as its lookup key. Literal angle brackets remain text after the inline pass (PART 9R R1; carve#5665).
# [<>][]<section id="s">
<h1><a href="#s"><></a></h1>
</section>Nested link with an inline note unwraps
1 conformance fixture
An inner link is unwrapped even when its text includes an inline note (CARVE-P12-007; carve#5666).
[[ ^[b]]()]()<p><a href=""> <sup id="fnref1">1</sup></a></p>
<section role="doc-endnotes" aria-label="Footnotes">
<hr>
<ol>
<li id="fn1">
<p>b<a href="#fnref1" role="doc-backlink" aria-label="Back to reference">↩</a></p>
</li>
</ol>
</section>A declined bracket tail releases an editorial comment
1 conformance fixture
The bracket run declines. Its failed tail does not claim the brace, so the editorial comment forms (PART 9 §9; carve#5673).
[[][[]]{#1}][]#}<p>[[][[]]<span class="critic-comment">1}][]</span></p>