Skip to content

Examples: Processor options

These are renderer and processor switches, not extensions; each changes how already-parsed core syntax is resolved or emitted.

Smart typography off

With the optional document-global smartTypography switch set to false, the whole converted set stays as authored ASCII; escapes, code spans and heading ids are unchanged (carve#338).

1 conformance fixture in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
He said "hello" and it's fine... a--b, c---d.

Arrows -> <- <-> => and comparisons != <= >= and (c) (r) (tm) +- stay as typed.

Escapes still consume the backslash: \" and \-\-.

Code spans never convert either way: `a--b "q" (c)`.

# Don't repeat yourself
html
<p>He said "hello" and it's fine... a--b, c---d.</p>
<p>Arrows -&gt; &lt;- &lt;-&gt; =&gt; and comparisons != &lt;= &gt;= and (c) (r) (tm) +- stay as typed.</p>
<p>Escapes still consume the backslash: " and --.</p>
<p>Code spans never convert either way: <code>a--b "q" (c)</code>.</p>
<section id="Don-t-repeat-yourself">
  <h1>Don't repeat yourself</h1>
</section>

Smart typography at default (control)

CONTROL. The same document at DEFAULT typography: the crossref label takes the glyphs, exactly as the heading does. Without it the three cases above would also pass an engine that never applies typography to a crossref label at all.

1 conformance fixture in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
# The "quoted" -- heading

See </#The-quoted-heading>
text
The “quoted” – heading

See The “quoted” – heading

Section wrapper off

With the optional HTML-renderer sections switch set to false, no <section> is emitted: each heading carries the id it would have hoisted, alongside its other attributes, and the blocks that would have been section children stay siblings. Ids, dedup, crossrefs and implicit heading references are unchanged, and a heading inside a container renders exactly as it does with the wrapper on (PART 9 section 13; carve#427).

1 conformance fixture in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
{a=b .c}
# Auto slug

Body.

## Nested level

More.

> # Quoted

See </#Auto-slug> and [Nested level][].
html
<h1 a="b" class="c" id="Auto-slug">Auto slug</h1>
<p>Body.</p>
<h2 id="Nested-level">Nested level</h2>
<p>More.</p>
<blockquote>
  <h1 id="Quoted">Quoted</h1>
</blockquote>
<p>See <a href="#Auto-slug">Auto slug</a> and <a href="#Nested-level">Nested level</a>.</p>

Source-line annotation order

The data-source-line render annotation is emitted AFTER the generated heading id, not merely after the author's attributes (PART 10 section 1). An engine that stamps the line at parse time carries it inside the authored run, where the generated-last rule alone would put the id behind it; carve-rs did exactly that until a test caught it (carve#427).

1 conformance fixture in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
> ## Quoted

{a=b}
## Attributed
html
<blockquote data-source-line="1">
  <h2 id="Quoted" data-source-line="1">Quoted</h2>
</blockquote>
<h2 a="b" id="Attributed" data-source-line="4">Attributed</h2>

Markdown target, source typography

With the optional Markdown-renderer setting that emits the author source run instead of the glyph, quotes, dashes and the ellipsis stay as the ASCII that was typed (PART 9 section 8; carve#360).

2 conformance fixtures in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to
trail off. *Strong stays strong* on the Markdown target.
markdown
The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to
trail off. **Strong stays strong** on the Markdown target.
carve
# The "quoted" -- heading

See </#The-quoted-heading>
markdown
# The "quoted" -- heading {#The-quoted-heading}

See [The "quoted" -- heading](#The-quoted-heading)

Plain-text target, source typography

With smartTypography set to source, the plain-text target emits the author's runs: the quotes, the double hyphen and the three dots stay as typed. A code span and strong emphasis are flattened the same way either mode (PART 9 section 8; carve#560).

2 conformance fixtures in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
# The renderer's output

The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to
trail off. `--fmt` and *strong* are untouched either way.
text
The renderer's output

The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to trail off. --fmt and strong are untouched either way.
carve
# The "quoted" -- heading

See </#The-quoted-heading>
text
The "quoted" -- heading

See The "quoted" -- heading

ANSI target, source typography

The ANSI target carries the mode too, and its heading rule is a COLUMN count of the rendered heading rather than of the source: 'The renderer's output' is 21 columns whether the apostrophe is typed or curled, so the rule is 21 either way (PART 9 section 8; carve#560).

2 conformance fixtures in tests/corpus-optional

Pinned when this feature is enabled - not part of the mandatory corpus.

carve
# The renderer's output

The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to
trail off. `--fmt` and *strong* are untouched either way.
The renderer's output
═════════════════════

The API returns "statusFilter" and the flag 'verification-link-sent'.

Use 1--3 for a range, an aside -- like this one -- for a break, and ... to trail off. --fmt and strong are untouched either way.
carve
# The "quoted" -- heading

See </#The-quoted-heading>
The "quoted" -- heading
═══════════════════════

See The "quoted" -- heading

Released under the MIT License.