parseltongue/ Md Edgecases

Markdown Edge Cases

Pattern: test harness — exercises every markdown construct the notebook renderer must handle, mixed with [[ref]] syntax.

pltg — minimal facts for ref testing ▸
arr = 2.8Mnrr = 180cac = 18,200ltv = 89,400cash = 8.2Mltv-to-cac = 4.91retention-ok = (> ?n 130) ✖retention-check = true ⚠burn-ratio = 0.65% ✖health-label = healthy ✖arr-stated = 2.8M ✖arr-vs-memo = 2.8M = 2.8M ⚠nrr-model-estimate = 155 ✖growth-adjusted-arr = 5.0M ✖projected-q4-arr = 9.1M ✖annual-revenue-rate = 24.2M ✖runway-months = 4.07 ✖runway-status = critical ✖runway-is-safe = false ⚠nrr-vs-model = 180 ≠ 155 ⚠

All node kinds

Every kind the renderer must color correctly:

  • Fact: $2.8M[1] ARR
    1arr
  • Axiom: (> ?n 130)[2✖] threshold
    2retention-ok ✖
  • Derive: true[3⚠] check
    3retention-check ⚠
  • Defterm: 0.65%[4✖] burn ratio, healthy[5✖] label
    4burn-ratio ✖ 5health-label ✖
  • Diff (coherent): 2.8M = 2.8M[6⚠] validation
    6arr-vs-memo ⚠
  • Diff (divergent): 180 ≠ 155[7⚠] model disagrees
    7nrr-vs-model ⚠

Inline formatting

Plain text with bold, italic, bold-italic, and inline code. Also bold with code inside and italic with code inside.

Refs inside formatting: $2.8M[1] revenue, 180%[8] retention, not a ref [[fact:arr]] (code escapes refs).

1arr 8nrr

Adjacent refs: 2.8M[1], 180[8], 18,200[9] — these should get comma separators.

1arr 8nrr 9cac

Silent refs work too[3⚠] — just a footnote number.

3retention-check ⚠

Heading level 3

Heading level 4 with bold and 2.8M[1]

1arr
Heading level 5
Heading level 6

Lists

Unordered

  • First item with 2.8M[1] ref
    1arr
  • Second item with bold and italic
  • Third item with code and a 4.91x[10] ratio
    10ltv-to-cac

Ordered

  1. Revenue: $2.8M[1]
    1arr
  2. Retention: 180%[8]
    8nrr
  3. Unit economics: 4.91x[10] LTV/CAC
    10ltv-to-cac

Nested lists

  • Top level
    • Nested item with 8.2M[11] cash
      11cash
    • Another nested
      • Deep nested with bold ref 180%[8]
        8nrr
  • Back to top

Mixed content in items

  • This item has code, bold, italic, and $2.8M[1] all in one line
    1arr
  • This one just has plain text

Tables

Metric Value Status
ARR $2.8M[1] good
NRR 180%[8] strong
LTV/CAC 4.91x[10] excellent
CAC $18,200[9] ok
1arr 8nrr 10ltv-to-cac 9cac

Table without refs

Left Center Right
a b c
bold italic code

Block quotes

This is a block quote with 2.8M[1] ARR. It spans multiple lines with formatting.

1arr

Nested quote with a ref: 180%[8] NRR is well above the true[3⚠] threshold.

8nrr 3retention-check ⚠

Code blocks

Fenced with info string:

def check_metrics(arr, nrr):
    """Not parsed for [[refs]] — raw code."""
    return arr > 1_000_000 and nrr > 130

Fenced without info:

plain fenced block
no highlighting, no [[ref]] parsing

Thematic breaks

Above the break.


Below the break.


Another break style.

Edge cases

Empty emphasis

Text with ** ** empty bold and * * empty italic (should render literally).

Refs at boundaries

Start of paragraph: 2.8M[1] is the ARR.

1arr

End of paragraph: the ARR is 2.8M[1]

1arr

Ref alone: 180[8]

8nrr

Multiple refs in one sentence

The company has $2.8M[1] ARR with 180%[8] NRR, $89,400[12] LTV vs $18,200[9] CAC giving 4.91x[10] ratio and $8.2M[11] cash.

1arr 8nrr 12ltv 9cac 10ltv-to-cac 11cash

Prefixed and suffixed refs

$2.8M[1] with dollar prefix, 180%[8] with percent suffix, 4.91x[10] with x suffix.

1arr 8nrr 10ltv-to-cac

Silent refs in prose

All checks pass[3⚠] and metrics look healthy.

3retention-check ⚠

Summary

$2.8M[1] ARR | 180%[8] NRR | 4.91x[10] LTV/CAC — strong fundamentals with $8.2M[11] runway.

1arr 8nrr 10ltv-to-cac 11cash

Aliased imports in refs

An alias valid in a code block must be valid in a prose ref — the alias here is deliberately different from the module name (regression case for issue #20, where alias-qualified refs silently degraded to plain text).

pltg — alias ≠ module name ▸
Out: True

Aliased ref: $245,000[13] MRR. Aliased with suffix: 340%[14] YoY. Module-qualified still works: $2.1M[15] enterprise ARR. Adjacent aliased refs: 2.4M[16], 480,000[17] — comma-separated like any others. Silent run collapses to one bracket: metrics hold[13, 16, 17] — three footnotes, one superscript.

13af.mrr 14af.yoy-growth-pct 15ai2ai_facts.enterprise-arr 16af.revenue 17af.cogs
[1]arr = 2.8M
[2]retention-ok = (> ?n 130)
[3]retention-check = true
[4]burn-ratio = 0.65%
[5]health-label = healthy
[6]arr-vs-memo = 2.8M = 2.8M
[7]nrr-vs-model = 180 ≠ 155
[8]nrr = 180
[9]cac = 18,200
[10]ltv-to-cac = 4.91
[11]cash = 8.2M
[12]ltv = 89,400
[13]af.mrr = 245,000
[14]af.yoy-growth-pct = 340
[15]ai2ai_facts.enterprise-arr = 2.1M
[16]af.revenue = 2.4M
[17]af.cogs = 480,000
Diagnostics5 errors · 81 info
error 5 ▸
info 81 ▸
System 87 facts 9 terms 1 axioms 3 theorems 86 issues

?
Developed by sci2sci
Need to convert data and documents to knowledge safely at enterprise scale?
Try VectorCat!