git.iko.soy/typeable/pandoc
on master help sign in
Fixed small bug in RST list parsing.
1a23bc6John MacFarlane
src/Text/Pandoc/Readers/RST.hs+2−3
@@ -548,8 +548,7 @@ listItem :: PandocMonad m
548listItem start = try $ do
548listItem start = try $ do
549 (markerLength, first) <- rawListItem start
549 (markerLength, first) <- rawListItem start
550 rest <- many (listContinuation markerLength)
550 rest <- many (listContinuation markerLength)
551− blanks <- choice [ try (many blankline <* lookAhead start),
551+ skipMany1 blankline <|> () <$ lookAhead start
552− many1 blankline ] -- whole list must end with blank.
553 -- parsing with ListItemState forces markers at beginning of lines to
552 -- parsing with ListItemState forces markers at beginning of lines to
554 -- count as list item markers, even if not separated by blank space.
553 -- count as list item markers, even if not separated by blank space.
555 -- see definition of "endline"
554 -- see definition of "endline"
@@ -557,7 +556,7 @@ listItem start = try $ do
557 let oldContext = stateParserContext state
556 let oldContext = stateParserContext state
558 setState $ state {stateParserContext = ListItemState}
557 setState $ state {stateParserContext = ListItemState}
559 -- parse the extracted block, which may itself contain block elements
558 -- parse the extracted block, which may itself contain block elements
560− parsed <- parseFromString parseBlocks $ concat (first:rest) ++ blanks
559+ parsed <- parseFromString parseBlocks $ concat (first:rest) ++ "\n"
561 updateState (\st -> st {stateParserContext = oldContext})
560 updateState (\st -> st {stateParserContext = oldContext})
562 return $ case B.toList parsed of
561 return $ case B.toList parsed of
563 [Para xs] -> B.singleton $ Plain xs
562 [Para xs] -> B.singleton $ Plain xs
test/command/3432a.mdnew file+19
@@ -0,0 +1,19 @@
1+```
2+% pandoc -f rst
3+* - a
4+ - b
5+* - c
6+ - d
7+^D
8+<ul>
9+<li><ul>
10+<li>a</li>
11+<li>b</li>
12+</ul></li>
13+<li><ul>
14+<li>c</li>
15+<li>d</li>
16+</ul></li>
17+</ul>
18+```
19+