git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: don't align ordered list items

It leads to problems with round-trip test, because aligned line blocks can't be read back.

commit6f507336918baa016eefce854f00fad1e1a78068 authorAlexander Krotov <ilabdsf@gmail.com> dateWed 21 Mar 2018, 17:32 (9 years ago) parentf12348c
3 files changed+10−13
src/Text/Pandoc/Writers/Muse.hs+1−4 test/Tests/Writers/Muse.hs+6−6 test/writer.muse+3−3
src/Text/Pandoc/Writers/Muse.hs+1−4
@@ -175,10 +175,7 @@ blockToMuse (BlockQuote blocks) = do
175175blockToMuse (OrderedList (start, style, _) items) = do
176176 let markers = take (length items) $ orderedListMarkers
177177 (start, style, Period)
178− let maxMarkerLength = maximum $ map length markers
179− let markers' = map (\m -> let s = maxMarkerLength - length m
180− in m ++ replicate s ' ') markers
181− contents <- zipWithM orderedListItemToMuse markers' items
178+ contents <- zipWithM orderedListItemToMuse markers items
182179 -- ensure that sublists have preceding blank line
183180 topLevel <- gets stTopLevel
184181 return $ cr $$ (if topLevel then nest 1 else id) (vcat contents) $$ blankline
test/Tests/Writers/Muse.hs+6−6
@@ -74,8 +74,8 @@ tests = [ testGroup "block elements"
7474 , plain $ text "second"
7575 , plain $ text "third"
7676 ]
77− =?> unlines [ " I. first"
78− , " II. second"
77+ =?> unlines [ " I. first"
78+ , " II. second"
7979 , " III. third"
8080 ]
8181 , "bullet list" =: bulletList [ plain $ text "first"
@@ -138,11 +138,11 @@ tests = [ testGroup "block elements"
138138 orderedListWith (1, UpperRoman, DefaultDelim) [ para $ text "Third"
139139 , para $ text "Fourth"
140140 ] =?>
141− unlines [ " I. First"
141+ unlines [ " I. First"
142142 , " II. Second"
143143 , ""
144144 , ""
145− , " I. Third"
145+ , " I. Third"
146146 , " II. Fourth"
147147 ]
148148 , "ordered lists with equal styles" =:
@@ -169,7 +169,7 @@ tests = [ testGroup "block elements"
169169 unlines [ " - First"
170170 , " - Second"
171171 , ""
172− , " I. Third"
172+ , " I. Third"
173173 , " II. Fourth"
174174 ]
175175 , "different style ordered lists" =:
@@ -179,7 +179,7 @@ tests = [ testGroup "block elements"
179179 orderedListWith (1, Decimal, DefaultDelim) [ para $ text "Third"
180180 , para $ text "Fourth"
181181 ] =?>
182− unlines [ " I. First"
182+ unlines [ " I. First"
183183 , " II. Second"
184184 , ""
185185 , " 1. Third"
test/writer.muse+3−3
@@ -224,9 +224,9 @@ Same thing but with paragraphs:
224224 with a continuation
225225
226226 iv. sublist with roman numerals, starting with 4
227− v. more items
228− A. a subsublist
229− B. a subsublist
227+ v. more items
228+ A. a subsublist
229+ B. a subsublist
230230
231231Nesting:
232232