diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 434cd1cf7..e2b55daa0 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -225,7 +225,7 @@ blockToRST opts (DefinitionList items) = do bulletListItemToRST :: WriterOptions -> [Block] -> State WriterState Doc bulletListItemToRST opts items = do contents <- blockListToRST opts items - return $ hang (text "- ") (writerTabStop opts) contents + return $ hang (text "- ") 3 contents -- | Convert ordered list item (a list of blocks) to RST. orderedListItemToRST :: WriterOptions -- ^ options @@ -234,7 +234,7 @@ orderedListItemToRST :: WriterOptions -- ^ options -> State WriterState Doc orderedListItemToRST opts marker items = do contents <- blockListToRST opts items - return $ hang (text marker) (writerTabStop opts) contents + return $ hang (text marker) (length marker + 1) contents -- | Convert defintion list item (label, list of blocks) to RST. definitionListItemToRST :: WriterOptions -> ([Inline], [Block]) -> State WriterState Doc diff --git a/tests/writer.rst b/tests/writer.rst index 77888c234..78ebd3ebf 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -155,52 +155,52 @@ Unordered Asterisks tight: -- asterisk 1 -- asterisk 2 -- asterisk 3 +- asterisk 1 +- asterisk 2 +- asterisk 3 Asterisks loose: -- asterisk 1 +- asterisk 1 -- asterisk 2 +- asterisk 2 -- asterisk 3 +- asterisk 3 Pluses tight: -- Plus 1 -- Plus 2 -- Plus 3 +- Plus 1 +- Plus 2 +- Plus 3 Pluses loose: -- Plus 1 +- Plus 1 -- Plus 2 +- Plus 2 -- Plus 3 +- Plus 3 Minuses tight: -- Minus 1 -- Minus 2 -- Minus 3 +- Minus 1 +- Minus 2 +- Minus 3 Minuses loose: -- Minus 1 +- Minus 1 -- Minus 2 +- Minus 2 -- Minus 3 +- Minus 3 Ordered @@ -243,10 +243,10 @@ and using spaces: Multiple paragraphs: -1. Item 1, graf one. +1. Item 1, graf one. - Item 1. graf two. The quick brown fox jumped over the lazy dog's - back. + Item 1. graf two. The quick brown fox jumped over the lazy dog's + back. 2. Item 2. @@ -257,11 +257,11 @@ Nested ------ -- Tab - - - Tab - - - Tab +- Tab + + - Tab + + - Tab @@ -269,11 +269,11 @@ Here's another: 1. First -2. Second: - - - Fee - - Fie - - Foe +2. Second: + + - Fee + - Fie + - Foe 3. Third @@ -282,12 +282,12 @@ Same thing but with paragraphs: 1. First -2. Second: +2. Second: - - - Fee - - Fie - - Foe + + - Fee + - Fie + - Foe 3. Third @@ -296,14 +296,14 @@ Tabs and spaces --------------- -- this is a list item indented with tabs +- this is a list item indented with tabs -- this is a list item indented with spaces +- 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 tabs - - this is an example list item indented with spaces + - this is an example list item indented with spaces @@ -328,13 +328,13 @@ Fancy list markers Nesting: -A. Upper Alpha - - I. Upper Roman. - - (6) Decimal start with 6 - - c) Lower alpha with paren +A. Upper Alpha + + I. Upper Roman. + + (6) Decimal start with 6 + + c) Lower alpha with paren @@ -343,9 +343,9 @@ Autonumbering: #. Autonumber. -#. More. - - #. Nested. +#. More. + + #. Nested. Should not be a list item: @@ -642,24 +642,24 @@ LaTeX ===== -- \cite[22-23]{smith.1899} -- \doublespacing -- $2+2=4$ -- $x \in y$ -- $\alpha \wedge \omega$ -- $223$ -- $p$-Tree -- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ -- Here's one that has a line break in it: - $\alpha + \omega \times x^2$. +- \cite[22-23]{smith.1899} +- \doublespacing +- $2+2=4$ +- $x \in y$ +- $\alpha \wedge \omega$ +- $223$ +- $p$-Tree +- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ +- Here's one that has a line break in it: + $\alpha + \omega \times x^2$. These shouldn't be math: -- To get the famous equation, write ``$e = mc^2$``. -- $22,000 is a *lot* of money. So is $34,000. (It worked if "lot" - is emphasized.) -- Escaped ``$``: $73 *this should be emphasized* 23$. +- To get the famous equation, write ``$e = mc^2$``. +- $22,000 is a *lot* of money. So is $34,000. (It worked if "lot" + is emphasized.) +- Escaped ``$``: $73 *this should be emphasized* 23$. Here's a LaTeX table: @@ -680,11 +680,11 @@ Special Characters Here is some unicode: -- I hat: Î -- o umlaut: ö -- section: § -- set membership: ∈ -- copyright: © +- I hat: Î +- o umlaut: ö +- section: § +- set membership: ∈ +- copyright: © AT&T has an ampersand in their name. @@ -802,9 +802,9 @@ Autolinks With an ampersand: http://example.com/?foo=1&bar=2 -- In a list? -- http://example.com/ -- It should. +- In a list? +- http://example.com/ +- It should. An e-mail address: nobody@nowhere.net