git.iko.soy/typeable/pandoc
on master help sign in
+ Fixed bug in RST writer's handling of ordered lists. Previously,
9cadf53fiddlosopher
src/Text/Pandoc/Writers/RST.hs+2−2
@@ -225,7 +225,7 @@ blockToRST opts (DefinitionList items) = do
225bulletListItemToRST :: WriterOptions -> [Block] -> State WriterState Doc
225bulletListItemToRST :: WriterOptions -> [Block] -> State WriterState Doc
226bulletListItemToRST opts items = do
226bulletListItemToRST opts items = do
227 contents <- blockListToRST opts items
227 contents <- blockListToRST opts items
228− return $ hang (text "- ") (writerTabStop opts) contents
228+ return $ hang (text "- ") 3 contents
229
229
230-- | Convert ordered list item (a list of blocks) to RST.
230-- | Convert ordered list item (a list of blocks) to RST.
231orderedListItemToRST :: WriterOptions -- ^ options
231orderedListItemToRST :: WriterOptions -- ^ options
@@ -234,7 +234,7 @@ orderedListItemToRST :: WriterOptions -- ^ options
234 -> State WriterState Doc
234 -> State WriterState Doc
235orderedListItemToRST opts marker items = do
235orderedListItemToRST opts marker items = do
236 contents <- blockListToRST opts items
236 contents <- blockListToRST opts items
237− return $ hang (text marker) (writerTabStop opts) contents
237+ return $ hang (text marker) (length marker + 1) contents
238
238
239-- | Convert defintion list item (label, list of blocks) to RST.
239-- | Convert defintion list item (label, list of blocks) to RST.
240definitionListItemToRST :: WriterOptions -> ([Inline], [Block]) -> State WriterState Doc
240definitionListItemToRST :: WriterOptions -> ([Inline], [Block]) -> State WriterState Doc
tests/writer.rst+73−73
@@ -155,52 +155,52 @@ Unordered
155Asterisks tight:
155Asterisks tight:
156
156
157
157
158−- asterisk 1
158+- asterisk 1
159−- asterisk 2
159+- asterisk 2
160−- asterisk 3
160+- asterisk 3
161
161
162Asterisks loose:
162Asterisks loose:
163
163
164
164
165−- asterisk 1
165+- asterisk 1
166
166
167−- asterisk 2
167+- asterisk 2
168
168
169−- asterisk 3
169+- asterisk 3
170
170
171
171
172Pluses tight:
172Pluses tight:
173
173
174
174
175−- Plus 1
175+- Plus 1
176−- Plus 2
176+- Plus 2
177−- Plus 3
177+- Plus 3
178
178
179Pluses loose:
179Pluses loose:
180
180
181
181
182−- Plus 1
182+- Plus 1
183
183
184−- Plus 2
184+- Plus 2
185
185
186−- Plus 3
186+- Plus 3
187
187
188
188
189Minuses tight:
189Minuses tight:
190
190
191
191
192−- Minus 1
192+- Minus 1
193−- Minus 2
193+- Minus 2
194−- Minus 3
194+- Minus 3
195
195
196Minuses loose:
196Minuses loose:
197
197
198
198
199−- Minus 1
199+- Minus 1
200
200
201−- Minus 2
201+- Minus 2
202
202
203−- Minus 3
203+- Minus 3
204
204
205
205
206Ordered
206Ordered
@@ -243,10 +243,10 @@ and using spaces:
243Multiple paragraphs:
243Multiple paragraphs:
244
244
245
245
246−1. Item 1, graf one.
246+1. Item 1, graf one.
247
247
248− Item 1. graf two. The quick brown fox jumped over the lazy dog's
248+ Item 1. graf two. The quick brown fox jumped over the lazy dog's
249− back.
249+ back.
250
250
2512. Item 2.
2512. Item 2.
252
252
@@ -257,11 +257,11 @@ Nested
257------
257------
258
258
259
259
260−- Tab
260+- Tab
261−
261+
262− - Tab
262+ - Tab
263−
263+
264− - Tab
264+ - Tab
265
265
266
266
267
267
@@ -269,11 +269,11 @@ Here's another:
269
269
270
270
2711. First
2711. First
272−2. Second:
272+2. Second:
273−
273+
274− - Fee
274+ - Fee
275− - Fie
275+ - Fie
276− - Foe
276+ - Foe
277
277
2783. Third
2783. Third
279
279
@@ -282,12 +282,12 @@ Same thing but with paragraphs:
282
282
2831. First
2831. First
284
284
285−2. Second:
285+2. Second:
286
286
287−
287+
288− - Fee
288+ - Fee
289− - Fie
289+ - Fie
290− - Foe
290+ - Foe
291
291
2923. Third
2923. Third
293
293
@@ -296,14 +296,14 @@ Tabs and spaces
296---------------
296---------------
297
297
298
298
299−- this is a list item indented with tabs
299+- this is a list item indented with tabs
300
300
301−- this is a list item indented with spaces
301+- this is a list item indented with spaces
302
302
303−
303+
304− - this is an example list item indented with tabs
304+ - this is an example list item indented with tabs
305
305
306− - this is an example list item indented with spaces
306+ - this is an example list item indented with spaces
307
307
308
308
309
309
@@ -328,13 +328,13 @@ Fancy list markers
328Nesting:
328Nesting:
329
329
330
330
331−A. Upper Alpha
331+A. Upper Alpha
332−
332+
333− I. Upper Roman.
333+ I. Upper Roman.
334−
334+
335− (6) Decimal start with 6
335+ (6) Decimal start with 6
336−
336+
337− c) Lower alpha with paren
337+ c) Lower alpha with paren
338
338
339
339
340
340
@@ -343,9 +343,9 @@ Autonumbering:
343
343
344
344
345#. Autonumber.
345#. Autonumber.
346−#. More.
346+#. More.
347−
347+
348− #. Nested.
348+ #. Nested.
349
349
350
350
351Should not be a list item:
351Should not be a list item:
@@ -642,24 +642,24 @@ LaTeX
642=====
642=====
643
643
644
644
645−- \cite[22-23]{smith.1899}
645+- \cite[22-23]{smith.1899}
646−- \doublespacing
646+- \doublespacing
647−- $2+2=4$
647+- $2+2=4$
648−- $x \in y$
648+- $x \in y$
649−- $\alpha \wedge \omega$
649+- $\alpha \wedge \omega$
650−- $223$
650+- $223$
651−- $p$-Tree
651+- $p$-Tree
652−- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
652+- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
653−- Here's one that has a line break in it:
653+- Here's one that has a line break in it:
654− $\alpha + \omega \times x^2$.
654+ $\alpha + \omega \times x^2$.
655
655
656These shouldn't be math:
656These shouldn't be math:
657
657
658
658
659−- To get the famous equation, write ``$e = mc^2$``.
659+- To get the famous equation, write ``$e = mc^2$``.
660−- $22,000 is a *lot* of money. So is $34,000. (It worked if "lot"
660+- $22,000 is a *lot* of money. So is $34,000. (It worked if "lot"
661− is emphasized.)
661+ is emphasized.)
662−- Escaped ``$``: $73 *this should be emphasized* 23$.
662+- Escaped ``$``: $73 *this should be emphasized* 23$.
663
663
664Here's a LaTeX table:
664Here's a LaTeX table:
665
665
@@ -680,11 +680,11 @@ Special Characters
680Here is some unicode:
680Here is some unicode:
681
681
682
682
683−- I hat: Î
683+- I hat: Î
684−- o umlaut: ö
684+- o umlaut: ö
685−- section: §
685+- section: §
686−- set membership: ∈
686+- set membership: ∈
687−- copyright: ©
687+- copyright: ©
688
688
689AT&T has an ampersand in their name.
689AT&T has an ampersand in their name.
690
690
@@ -802,9 +802,9 @@ Autolinks
802With an ampersand: http://example.com/?foo=1&bar=2
802With an ampersand: http://example.com/?foo=1&bar=2
803
803
804
804
805−- In a list?
805+- In a list?
806−- http://example.com/
806+- http://example.com/
807−- It should.
807+- It should.
808
808
809An e-mail address: nobody@nowhere.net
809An e-mail address: nobody@nowhere.net
810
810