Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Cover the rest of the man macros
Diffstat (limited to 'tests/extensions/test-about-render.lua')
| -rw-r--r-- | tests/extensions/test-about-render.lua | 25 |
1 file changed, 25 insertions, 0 deletions
diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index d5d2d2e..fd57d4e 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -532,6 +532,31 @@ out = render("page.1", ".TH title 1\nbody") h.excludes("the title macro renders nothing itself", out, "title 1") h.contains("the body after it renders", out, "<p>body</p>") +out = render("page.1", ".IP 1. 4\nFirst.") +h.contains("a number leads its item", out, "<p>1. \nFirst.</p>") + +out = render("page.1", "a\n.PP\nb\n.LP\nc\n.P\nd\n.HP\ne\n.RS\nf\n.RE\ng") +h.contains("each paragraph macro starts a paragraph", out, + "<p>a</p><p>b</p><p>c</p><p>d</p><p>e</p><p>f</p><p>g</p>") + +out = render("page.1", ".I word") +h.contains("the italic macro renders emphasis", out, "<p><em>word</em></p>") + +out = render("page.1", ".RB a b\n.RI c d\n.BI e f\n.IB g h") +h.contains("every alternating macro switches its fonts", out, + "<p>a<strong>b</strong>\nc<em>d</em>\n<strong>e</strong><em>f</em>\n<em>g</em><strong>h</strong></p>") + +out = render("page.1", ".XY some words") +h.contains("an unknown macro's arguments are drawn as text", out, "<p>some words</p>") + +out = render("page.1", ".ig\nhidden\n..\n.am x\nhidden\n..\n.de1 y\nhidden\n..\n.y gone\nshown") +h.equals("every kind of definition is skipped, and so are its uses", out, + "<div class='markdown'><p>shown</p></div>") + +out = render("page.1", ".SH <b>\n<b> & text") +h.contains("markup in a man heading is escaped", out, "<h2 id='b'><b></h2>") +h.contains("markup in man text is escaped", out, "<p><b> & text</p>") + -- A parse that fails falls back to escaped plain text, and an emit that -- fails part way still closes the wrapper, so neither ends the request in -- an error. These load a broken copy of the script, so they come last. |
