Man reader: fix code block tests.
They incorporated a spurious newline which needs to be removed.
This commit is contained in:
parent
07a0835824
commit
4625150f4c
2 changed files with 4 additions and 3 deletions
|
@ -655,6 +655,7 @@ parseCodeBlock = try $ do
|
||||||
|
|
||||||
removeFinalNewline [] = []
|
removeFinalNewline [] = []
|
||||||
removeFinalNewline xs = if last xs == '\n' then init xs else xs
|
removeFinalNewline xs = if last xs == '\n' then init xs else xs
|
||||||
|
|
||||||
extractText :: ManToken -> Maybe String
|
extractText :: ManToken -> Maybe String
|
||||||
extractText (MLine ss) = Just $ linePartsToString ss
|
extractText (MLine ss) = Just $ linePartsToString ss
|
||||||
extractText MEmptyLine = Just ""
|
extractText MEmptyLine = Just ""
|
||||||
|
|
|
@ -14,16 +14,16 @@ Pandoc (Meta {unMeta = fromList [("date",MetaInlines [Str "Oct",Space,Str "17,",
|
||||||
,Header 1 ("",[],[]) [Str "Block",Space,Str "Quotes"]
|
,Header 1 ("",[],[]) [Str "Block",Space,Str "Quotes"]
|
||||||
,Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
|
,Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
|
||||||
,BlockQuote
|
,BlockQuote
|
||||||
[CodeBlock ("",[],[]) "\nsub status {\n print \"working\";\n}"]
|
[CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}"]
|
||||||
,Para [Str "A",Space,Str "list:"]
|
,Para [Str "A",Space,Str "list:"]
|
||||||
,OrderedList (1,Decimal,Period)
|
,OrderedList (1,Decimal,Period)
|
||||||
[[Para [Str "item",Space,Str "one"]]
|
[[Para [Str "item",Space,Str "one"]]
|
||||||
,[Para [Str "item",Space,Str "two"]]]
|
,[Para [Str "item",Space,Str "two"]]]
|
||||||
,Header 1 ("",[],[]) [Str "Code",Space,Str "Blocks"]
|
,Header 1 ("",[],[]) [Str "Code",Space,Str "Blocks"]
|
||||||
,Para [Str "Code:"]
|
,Para [Str "Code:"]
|
||||||
,CodeBlock ("",[],[]) "\n---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n"
|
,CodeBlock ("",[],[]) "---- (should be four hyphens)\n\nsub status {\n print \"working\";\n}\n"
|
||||||
,Para [Str "And:"]
|
,Para [Str "And:"]
|
||||||
,CodeBlock ("",[],[]) "\n\tthis code line is indented by one tab"
|
,CodeBlock ("",[],[]) "\tthis code line is indented by one tab"
|
||||||
,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"]
|
,Para [Str "*",Space,Str "*",Space,Str "*",Space,Str "*",Space,Str "*"]
|
||||||
,Header 1 ("",[],[]) [Str "Lists"]
|
,Header 1 ("",[],[]) [Str "Lists"]
|
||||||
,Header 2 ("",[],[]) [Str "Unordered"]
|
,Header 2 ("",[],[]) [Str "Unordered"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue