From 4d7b3f076e1b908bbf0dfbed9c24b7659d038fea Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:41:32 -1000 Subject: Cover the rest of the markdown grammar The changelog for 2.12.0 says a list split by a code block keeps counting, and only the split by a blank line was checked. --- tests/extensions/test-about-render.lua | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index bdd4d84..d5d2d2e 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -384,9 +384,62 @@ h.contains("a change of marker splits the list", out, "
    ") out = render("README.md", "- a **bold** item") h.contains("list items parse their text", out, "
  1. a bold item
  2. ") +out = render("README.md", "1. a\n```\nx\n```\n2. b") +h.contains("a list split by a code block keeps counting", out, + "
    1. a
    x\n
    1. b
    ") + +out = render("README.md", "+ a\n+ b") +h.contains("plus signs render an unordered list", out, "") + +out = render("README.md", "* a\n* b") +h.contains("stars render an unordered list", out, "") + +out = render("README.md", "### c\n#### d\n##### e\n###### f\n####### g") +h.contains("headings go down to the sixth level and no further", out, + "

    c

    d

    e
    f

    ####### g

    ") + +out = render("x.mkd", "# M") +h.contains("the mkd extension dispatches too", out, "

    M

    ") + +out = render("x.mdown", "# M") +h.contains("and so does mdown", out, "

    M

    ") + +out = render("README.md", "a\rb") +h.contains("a bare carriage return ends a line", out, "

    a\nb

    ") + +out = render("README.md", "a | b\n:--- | ---:\n1 | 2") +h.contains("a delimiter row needs no outer pipes and may carry colons", out, + "
    ab
    12
    ") + +out = render("README.md", "| a | b |\n|:-:|--:|\n| 1 | 2 |") +h.contains("a centred or right aligned column still makes a table", out, + "12") + +out = render("README.md", "| a | b |\n|---|---|\n| 1 |\n| 1 | 2 | 3 |") +h.contains("a row shorter or longer than the head keeps every cell", out, + "1123") + +out = render("README.md", "```\ncode\nmore") +h.contains("an unclosed fence runs to the end", out, + "
    code\nmore\n
    ") + +out = render("README.md", '[a](x "t")') +h.contains("a link title is dropped", out, "

    a

    ") + +out = render("README.md", "# a \n\n- \n\n> \n\n[](x)\n\n| |\n|---|\n| |") +h.contains("markup in a heading is escaped", out, "

    a <b>

    ") +h.contains("markup in a list item is escaped", out, "
  3. <b>
  4. ") +h.contains("markup in a quote is escaped", out, "

    <b>

    ") +h.contains("markup in link text is escaped", out, "<b>") +h.contains("markup in a table head is escaped", out, "<b>") +h.contains("markup in a table cell is escaped", out, "<i>") + out = render("README.md", string.rep("a", 512 * 1024 + 1)) h.contains("an oversized readme renders as plain text", out, "
    ")
     
    +out = render("README.md", string.rep("a", 512 * 1024))
    +h.equals("a readme of exactly the cap still renders as markup", out:sub(1, 25), "

    ") + -- Man pages. out = render("page.1", ".SH NAME") -- cgit 2.12.1