diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 5 | ||||
-rw-r--r-- | tests/testsuite.native | 2 | ||||
-rw-r--r-- | tests/testsuite.txt | 4 | ||||
-rw-r--r-- | tests/writer.context | 4 | ||||
-rw-r--r-- | tests/writer.docbook | 6 | ||||
-rw-r--r-- | tests/writer.html | 4 | ||||
-rw-r--r-- | tests/writer.latex | 4 | ||||
-rw-r--r-- | tests/writer.man | 4 | ||||
-rw-r--r-- | tests/writer.markdown | 4 | ||||
-rw-r--r-- | tests/writer.native | 2 | ||||
-rw-r--r-- | tests/writer.rst | 4 | ||||
-rw-r--r-- | tests/writer.rtf | 2 |
13 files changed, 46 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 6ee8df7b6..abf8061e0 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -334,8 +334,9 @@ anyOrderedListStart = try $ do if stateStrict state then do many1 digit char '.' + spaceChar return (1, DefaultStyle, DefaultDelim) - else anyOrderedListMarker + else anyOrderedListMarker >>~ spaceChar orderedListStart style delim = try $ do optional newline -- if preceded by a Plain block in a list context @@ -346,7 +347,7 @@ orderedListStart style delim = try $ do char '.' return 1 else orderedListMarker style delim - oneOf spaceChars + spaceChar skipSpaces -- parse a line of a list item (start = parser for beginning of list item) diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index ce8fedf02..878c1355c 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -418,7 +418,7 @@ listItem start = try $ do return parsed orderedList = try $ do - (start, style, delim) <- lookAhead anyOrderedListMarker + (start, style, delim) <- lookAhead (anyOrderedListMarker >>~ spaceChar) items <- many1 (listItem (orderedListStart style delim)) let items' = compactify items return $ OrderedList (start, style, delim) items' @@ -551,7 +551,8 @@ endline = try $ do -- parse potential list-starts at beginning of line differently in a list: st <- getState if ((stateParserContext st) == ListItemState) - then notFollowedBy' anyOrderedListMarker >> notFollowedBy' bulletListStart + then notFollowedBy (anyOrderedListMarker >> spaceChar) >> + notFollowedBy' bulletListStart else return () return Space diff --git a/tests/testsuite.native b/tests/testsuite.native index 11719eb16..9950341c4 100644 --- a/tests/testsuite.native +++ b/tests/testsuite.native @@ -178,6 +178,8 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane , OrderedList (1,DefaultStyle,DefaultDelim) [ [ Plain [Str "Nested",Str "."] ] ] ] ] +, Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"] +, Para [Str "M",Str ".",Str "A",Str ".",Space,Str "2007"] , HorizontalRule , Header 1 [Str "Definition",Space,Str "Lists"] , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] diff --git a/tests/testsuite.txt b/tests/testsuite.txt index 31b5c3bed..f8d9221b9 100644 --- a/tests/testsuite.txt +++ b/tests/testsuite.txt @@ -281,6 +281,10 @@ Autonumbering: #. More. #. Nested. +Should not be a list item: + +M.A. 2007 + * * * * * # Definition Lists diff --git a/tests/writer.context b/tests/writer.context index fe7c58851..c0b633117 100644 --- a/tests/writer.context +++ b/tests/writer.context @@ -399,6 +399,10 @@ Autonumbering: \item Nested. \stopltxenum \stopltxenum +Should not be a list item: + +M.A. 2007 + \thinrule \section{Definition Lists} diff --git a/tests/writer.docbook b/tests/writer.docbook index 390c9f4fe..7b3f39f34 100644 --- a/tests/writer.docbook +++ b/tests/writer.docbook @@ -642,6 +642,12 @@ These should not be escaped: \$ \\ \> \[ \{ </orderedlist> </listitem> </orderedlist> + <para> + Should not be a list item: + </para> + <para> + M.A. 2007 + </para> </section> </section> <section> diff --git a/tests/writer.html b/tests/writer.html index 6c3637315..46a95cde7 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -449,6 +449,10 @@ These should not be escaped: \$ \\ \> \[ \{ ></ol ></li ></ol + ><p + >Should not be a list item:</p + ><p + >M.A. 2007</p ><hr /><h1 id="definition-lists" >Definition Lists</h1 diff --git a/tests/writer.latex b/tests/writer.latex index fb771182f..ec35ae30d 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -345,6 +345,10 @@ Autonumbering: \item Nested. \end{enumerate} \end{enumerate} +Should not be a list item: + +M.A. 2007 + \begin{center}\rule{3in}{0.4pt}\end{center} \section{Definition Lists} diff --git a/tests/writer.man b/tests/writer.man index 05d766108..5b8d97094 100644 --- a/tests/writer.man +++ b/tests/writer.man @@ -322,6 +322,10 @@ More\. Nested\. .RE .PP +Should not be a list item: +.PP +M\.A\. 2007 +.PP * * * * * .SH Definition Lists .PP diff --git a/tests/writer.markdown b/tests/writer.markdown index 298e8e825..42f63abca 100644 --- a/tests/writer.markdown +++ b/tests/writer.markdown @@ -284,6 +284,10 @@ Autonumbering: 1. Nested. +Should not be a list item: + +M.A. 2007 + * * * * * diff --git a/tests/writer.native b/tests/writer.native index 11719eb16..9950341c4 100644 --- a/tests/writer.native +++ b/tests/writer.native @@ -178,6 +178,8 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane , OrderedList (1,DefaultStyle,DefaultDelim) [ [ Plain [Str "Nested",Str "."] ] ] ] ] +, Para [Str "Should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "list",Space,Str "item:"] +, Para [Str "M",Str ".",Str "A",Str ".",Space,Str "2007"] , HorizontalRule , Header 1 [Str "Definition",Space,Str "Lists"] , Para [Str "Tight",Space,Str "using",Space,Str "spaces:"] diff --git a/tests/writer.rst b/tests/writer.rst index 0f059761c..188df8c7b 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -348,6 +348,10 @@ Autonumbering: #. Nested. +Should not be a list item: + +M.A. 2007 + -------------- Definition Lists diff --git a/tests/writer.rtf b/tests/writer.rtf index 6ff422603..35607ebba 100644 --- a/tests/writer.rtf +++ b/tests/writer.rtf @@ -157,6 +157,8 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par} {\pard \ql \f0 \sa0 \li360 \fi-360 1.\tx360\tab Autonumber.\par} {\pard \ql \f0 \sa0 \li360 \fi-360 2.\tx360\tab More.\par} {\pard \ql \f0 \sa0 \li720 \fi-360 a.\tx360\tab Nested.\sa180\sa180\par} +{\pard \ql \f0 \sa180 \li0 \fi0 Should not be a list item:\par} +{\pard \ql \f0 \sa180 \li0 \fi0 M.A. 2007\par} {\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par} {\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 Definition Lists\par} {\pard \ql \f0 \sa180 \li0 \fi0 Tight using spaces:\par} |