Markdown writer: Avoid spurious blanklines at end of document...
after tables and list, for example.
This commit is contained in:
parent
b6e7bfaf1d
commit
bcfb77e2ab
7 changed files with 6 additions and 18 deletions
|
@ -214,7 +214,7 @@ pandocToMarkdown opts (Pandoc meta blocks) = do
|
|||
body <- blockListToMarkdown opts blocks'
|
||||
notesAndRefs' <- notesAndRefs opts
|
||||
let render' :: Doc -> String
|
||||
render' = render colwidth
|
||||
render' = render colwidth . chomp
|
||||
let main = render' $ body <> notesAndRefs'
|
||||
let context = defField "toc" (render' toc)
|
||||
$ defField "body" main
|
||||
|
|
|
@ -26,7 +26,4 @@ Nested grid tables.
|
|||
| | ----------- | |
|
||||
| +------------------------------------------------------------------+ |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
|
|
@ -9,8 +9,5 @@
|
|||
a
|
||||
1 2
|
||||
--- ---
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -8,6 +8,4 @@ Some text
|
|||
Some text
|
||||
|
||||
- element
|
||||
|
||||
|
||||
```
|
||||
|
|
|
@ -74,5 +74,3 @@ Multiline table without column headers:
|
|||
the blank line between
|
||||
rows.
|
||||
----------- ---------- ------------ --------------------------
|
||||
|
||||
|
||||
|
|
|
@ -74,5 +74,3 @@ Multiline table without column headers:
|
|||
the blank line between
|
||||
rows.
|
||||
----------- ---------- ------------ --------------------------
|
||||
|
||||
|
||||
|
|
|
@ -31,18 +31,18 @@
|
|||
<outline text="Code Blocks" _note="Code: ---- (should be four hyphens) sub status { print "working"; } this code block is indented by one tab And: this code block is indented by two tabs These should not be escaped: \$ \\ \> \[ \{ ------------------------------------------------------------------------">
|
||||
</outline>
|
||||
<outline text="Lists">
|
||||
<outline text="Unordered" _note="Asterisks tight: - asterisk 1 - asterisk 2 - asterisk 3 Asterisks loose: - asterisk 1 - asterisk 2 - asterisk 3 Pluses tight: - Plus 1 - Plus 2 - Plus 3 Pluses loose: - Plus 1 - Plus 2 - Plus 3 Minuses tight: - Minus 1 - Minus 2 - Minus 3 Minuses loose: - Minus 1 - Minus 2 - Minus 3 ">
|
||||
<outline text="Unordered" _note="Asterisks tight: - asterisk 1 - asterisk 2 - asterisk 3 Asterisks loose: - asterisk 1 - asterisk 2 - asterisk 3 Pluses tight: - Plus 1 - Plus 2 - Plus 3 Pluses loose: - Plus 1 - Plus 2 - Plus 3 Minuses tight: - Minus 1 - Minus 2 - Minus 3 Minuses loose: - Minus 1 - Minus 2 - Minus 3">
|
||||
</outline>
|
||||
<outline text="Ordered" _note="Tight: 1. First 2. Second 3. Third and: 1. One 2. Two 3. Three Loose using tabs: 1. First 2. Second 3. Third and using spaces: 1. One 2. Two 3. Three Multiple paragraphs: 1. Item 1, graf one. Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. 2. Item 2. 3. Item 3. ">
|
||||
<outline text="Ordered" _note="Tight: 1. First 2. Second 3. Third and: 1. One 2. Two 3. Three Loose using tabs: 1. First 2. Second 3. Third and using spaces: 1. One 2. Two 3. Three Multiple paragraphs: 1. Item 1, graf one. Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. 2. Item 2. 3. Item 3.">
|
||||
</outline>
|
||||
<outline text="Nested" _note="- Tab - Tab - Tab Here’s another: 1. First 2. Second: - Fee - Fie - Foe 3. Third Same thing but with paragraphs: 1. First 2. Second: - Fee - Fie - Foe 3. Third ">
|
||||
<outline text="Nested" _note="- Tab - Tab - Tab Here’s another: 1. First 2. Second: - Fee - Fie - Foe 3. Third Same thing but with paragraphs: 1. First 2. Second: - Fee - Fie - Foe 3. Third">
|
||||
</outline>
|
||||
<outline text="Tabs and spaces" _note="- this is a list item indented with tabs - this is a list item indented with spaces - this is an example list item indented with tabs - this is an example list item indented with spaces ">
|
||||
<outline text="Tabs and spaces" _note="- this is a list item indented with tabs - this is a list item indented with spaces - this is an example list item indented with tabs - this is an example list item indented with spaces">
|
||||
</outline>
|
||||
<outline text="Fancy list markers" _note="1. begins with 2 2. and now 3 with a continuation 1. sublist with roman numerals, starting with 4 2. more items 1. a subsublist 2. a subsublist Nesting: 1. Upper Alpha 1. Upper Roman. 1. Decimal start with 6 1. Lower alpha with paren Autonumbering: 1. Autonumber. 2. More. 1. Nested. Should not be a list item: M.A. 2007 B. Williams ------------------------------------------------------------------------">
|
||||
</outline>
|
||||
</outline>
|
||||
<outline text="Definition Lists" _note="Tight using spaces: apple red fruit orange orange fruit banana yellow fruit Tight using tabs: apple red fruit orange orange fruit banana yellow fruit Loose: apple red fruit orange orange fruit banana yellow fruit Multiple blocks with italics: *apple* red fruit contains seeds, crisp, pleasant to taste *orange* orange fruit { orange code block } > orange block quote Multiple definitions, tight: apple red fruit computer orange orange fruit bank Multiple definitions, loose: apple red fruit computer orange orange fruit bank Blank line after term, indented marker, alternate markers: apple red fruit computer orange orange fruit 1. sublist 2. sublist ">
|
||||
<outline text="Definition Lists" _note="Tight using spaces: apple red fruit orange orange fruit banana yellow fruit Tight using tabs: apple red fruit orange orange fruit banana yellow fruit Loose: apple red fruit orange orange fruit banana yellow fruit Multiple blocks with italics: *apple* red fruit contains seeds, crisp, pleasant to taste *orange* orange fruit { orange code block } > orange block quote Multiple definitions, tight: apple red fruit computer orange orange fruit bank Multiple definitions, loose: apple red fruit computer orange orange fruit bank Blank line after term, indented marker, alternate markers: apple red fruit computer orange orange fruit 1. sublist 2. sublist">
|
||||
</outline>
|
||||
<outline text="HTML Blocks" _note="Simple block on one line: foo And nested without indentation: foo bar Interpreted markdown in a table: This is *emphasized* And this is **strong** Here’s a simple block: foo This should be a code block, though: <div> foo </div> As should this: <div>foo</div> Now, nested: foo This should just be an HTML comment: Multiline: Code block: <!-- Comment --> Just plain comment, with trailing spaces on the line: Code: <hr /> Hr’s: ------------------------------------------------------------------------">
|
||||
</outline>
|
||||
|
|
Loading…
Add table
Reference in a new issue