From 4286180c059d0d2ed23ad155e76418ec00f21db9 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:34:17 -1000 Subject: Check what the nesting rules actually render The emphasis bomb checked only that the output was not empty, which it never is, and its input never nests. No input reaches the ceiling on inline nesting either, since an emphasis cannot hold its own kind, so the check now proves the nesting that does happen. Past the quote ceiling only the innermost text was looked for, and any x passed. --- tests/extensions/test-about-render.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/extensions') diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index 8c37f30..b9284c4 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -249,10 +249,13 @@ h.contains("quotes nest", out, "

deep

out = render("README.md", string.rep("> ", 30) .. "x") local _, quote_count = out:gsub("
", "") h.equals("quote nesting stops at the ceiling", quote_count, 24) -h.contains("the innermost text still renders", out, "x") +h.contains("the markers past it stay as text", out, "

> > > > > x

") -out = render("README.md", string.rep("*a", 200)) -h.check("an emphasis bomb still renders something", #out > 0) +-- Each kind of emphasis can hold the others but not itself, so inline +-- markup nests only a few levels deep and never reaches its ceiling. +out = render("README.md", "**__*_x_*__**") +h.contains("every kind of emphasis nests in the others", out, + "

x

") -- A hostile readme must cost about four times as much at four times the -- length, as a linear pass does, where a quadratic one costs sixteen times -- cgit 2.12.1