Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
| -rw-r--r-- | tests/extensions/test-about-render.lua | 9 |
1 file changed, 6 insertions, 3 deletions
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, "<blockquote><blockquote><p>deep</p></blockquote> out = render("README.md", string.rep("> ", 30) .. "x") local _, quote_count = out:gsub("<blockquote>", "") 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, "<p>> > > > > x</p>") -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, + "<p><strong><strong><em><em>x</em></em></strong></strong></p>") -- 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 |
