diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Run a paragraph's lines together like GitHub
GitHub shows a single newline in a markdown file as a space, and roff fills the lines of a man page the same way, so text wrapped in the source came out ragged on the about page.
Diffstat (limited to '')
-rw-r--r--tests/extensions/test-about-render.lua13
1 file changed, 10 insertions, 3 deletions
diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua
index 801cc45..b7d12c7 100644
--- a/tests/extensions/test-about-render.lua
+++ b/tests/extensions/test-about-render.lua
@@ -88,10 +88,17 @@ out = render("readme.markdown", "# Long")
h.contains("the long markdown extension dispatches too", out, "<h1>Long</h1>")
out = render("README.md", "line one\nline two")
-h.contains("a paragraph keeps its line break", out, "<p>line one<br>line two</p>")
+h.contains("the lines of a paragraph run together", out, "<p>line one\nline two</p>")
out = render("README.md", "first para\r\nsecond line")
-h.contains("crlf line endings are normalised", out, "<p>first para<br>second line</p>")
+h.contains("crlf line endings are normalised", out, "<p>first para\nsecond line</p>")
+
+out = render("README.md", "one \ntwo\\\nthree")
+h.contains("two trailing spaces break the line", out, "<p>one<br>\ntwo")
+h.contains("a trailing backslash breaks the line", out, "two<br>\nthree</p>")
+
+out = render("README.md", "spaces \n\nslash\\")
+h.contains("the last line takes no break", out, "<p>spaces</p><p>slash\\</p>")
out = render("README.md", "a **bold** and *leaning* word")
h.contains("double stars embolden", out, "<strong>bold</strong>")
@@ -239,7 +246,7 @@ out = render("page.3", ".SS Details")
h.contains("a subsection renders one level down", out, "<h3>Details</h3>")
out = render("page.1", ".B bold words\nplain after")
-h.contains("the bold macro renders strong", out, "<p><strong>bold words</strong><br>plain after</p>")
+h.contains("the bold macro renders strong", out, "<p><strong>bold words</strong>\nplain after</p>")
out = render("page.1", "a \\fBbold\\fR c")
h.contains("font escapes carry across a run", out, "<p>a <strong>bold</strong> c</p>")