From e814a3f6d23f640b1aed5b7cb949459d514a3e33 Mon Sep 17 00:00:00 2001
From: fiddlosopher
Date: Wed, 8 Aug 2007 02:43:15 +0000
Subject: Major change in the way ordered lists are handled: + The changes are
documented in README, under Lists. + The OrderedList block element now stores
information about list number style, list number delimiter, and starting
number. + The readers parse this information, when possible. + The writers
use this information to style ordered lists. + Test suites have been
changed accordingly.
Motivation: It's often useful to start lists with
numbers other than 1, and to have control over the
style of the list.
Added to Text.Pandoc.Shared:
+ camelCaseToHyphenated
+ toRomanNumeral
+ anyOrderedListMarker
+ orderedListMarker
+ orderedListMarkers
Added to Text.Pandoc.ParserCombinators:
+ charsInBalanced'
+ withHorizDisplacement
+ romanNumeral
RST writer:
+ Force blank line before lists, so that sublists will be handled
correctly.
LaTeX reader:
+ Fixed bug in parsing of footnotes containing multiple paragraphs,
introduced by use of charsInBalanced. Fix: use charsInBalanced'
instead.
LaTeX header:
+ use mathletters option in ucs package, so that basic unicode Greek
letters will work properly.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@834 788f1e2b-df1e-0410-8736-df70ead52e1b
---
tests/html-reader.html | 56 ++++++++++++++++++++
tests/html-reader.native | 47 +++++++++++++----
tests/rst-reader.native | 42 ++++++++++++---
tests/rst-reader.rst | 31 +++++++++++
tests/s5.basic.html | 2 +-
tests/s5.fancy.html | 2 +-
tests/s5.inserts.html | 2 +-
tests/tables.rst | 1 -
tests/testsuite.native | 48 +++++++++++++----
tests/testsuite.txt | 26 ++++++++++
tests/writer.context | 132 ++++++++++++++++++++++++++++++-----------------
tests/writer.docbook | 115 +++++++++++++++++++++++++++++++++++++----
tests/writer.html | 85 +++++++++++++++++++++++++-----
tests/writer.latex | 67 ++++++++++++++++++++----
tests/writer.man | 97 ++++++++++++++++++++++++----------
tests/writer.markdown | 31 +++++++++++
tests/writer.native | 48 +++++++++++++----
tests/writer.rst | 114 +++++++++++++++++++++++++++++++---------
tests/writer.rtf | 17 ++++++
19 files changed, 795 insertions(+), 168 deletions(-)
(limited to 'tests')
diff --git a/tests/html-reader.html b/tests/html-reader.html
index 2c00f48b4..da6c075b3 100644
--- a/tests/html-reader.html
+++ b/tests/html-reader.html
@@ -232,6 +232,62 @@ These should not be escaped: \$ \\ \> \[ \{
+Fancy list markers
- begins with 2
and now 3
with a continuation
- sublist with roman numerals, starting with 4
- more items
- a subsublist
- a subsublist
Nesting:
- Upper Alpha
- Upper Roman.
- Decimal start with 6
- Lower alpha with paren
Autonumbering:
- Autonumber.
- More.
- Nested.
Definition
- Violin
diff --git a/tests/html-reader.native b/tests/html-reader.native
index 242055f3d..59bf02e47 100644
--- a/tests/html-reader.native
+++ b/tests/html-reader.native
@@ -28,7 +28,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
[ Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
, CodeBlock "sub status {\n print \"working\";\n}"
, Para [Str "A",Space,Str "list:"]
- , OrderedList
+ , OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "item",Space,Str "one"] ]
, [ Plain [Str "item",Space,Str "two"] ] ]
, Para [Str "Nested",Space,Str "block",Space,Str "quotes:"]
@@ -44,7 +44,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
[ Para [Str "Example:"]
, CodeBlock "sub status {\n print \"working\";\n}" ]
, BlockQuote
- [ OrderedList
+ [ OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "do",Space,Str "laundry"] ]
, [ Plain [Str "take",Space,Str "out",Space,Str "the",Space,Str "trash"] ] ] ]
, Para [Str "Here's",Space,Str "a",Space,Str "nested",Space,Str "one:"]
@@ -95,27 +95,27 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
, [ Para [Str "Minus",Space,Str "3"] ] ]
, Header 2 [Str "Ordered"]
, Para [Str "Tight:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "First"] ]
, [ Plain [Str "Second"] ]
, [ Plain [Str "Third"] ] ]
, Para [Str "and:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "One"] ]
, [ Plain [Str "Two"] ]
, [ Plain [Str "Three"] ] ]
, Para [Str "Loose",Space,Str "using",Space,Str "tabs:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Para [Str "First"] ]
, [ Para [Str "Second"] ]
, [ Para [Str "Third"] ] ]
, Para [Str "and",Space,Str "using",Space,Str "spaces:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Para [Str "One"] ]
, [ Para [Str "Two"] ]
, [ Para [Str "Three"] ] ]
, Para [Str "Multiple",Space,Str "paragraphs:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."]
, Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog's",Space,Str "back."] ], [ Para [Str "Item",Space,Str "2."] ]
, [ Para [Str "Item",Space,Str "3."] ] ]
@@ -128,7 +128,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
[ [ Plain [Str "Tab"] ]
] ] ] ] ]
, Para [Str "Here's",Space,Str "another:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "First"] ]
, [ Plain [Str "Second:"]
, BulletList
@@ -136,7 +136,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
, [ Plain [Str "Fie"] ]
, [ Plain [Str "Foe"] ] ] ], [ Plain [Str "Third"] ] ]
, Para [Str "Same",Space,Str "thing",Space,Str "but",Space,Str "with",Space,Str "paragraphs:"]
-, OrderedList
+, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Para [Str "First"] ]
, [ Para [Str "Second:"]
, BulletList
@@ -150,6 +150,35 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] [] "")
, BulletList
[ [ Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",Space,Str "indented",Space,Str "with",Space,Str "tabs"] ]
, [ Para [Str "this",Space,Str "is",Space,Str "an",Space,Str "example",Space,Str "list",Space,Str "item",Space,Str "indented",Space,Str "with",Space,Str "spaces"] ] ] ] ]
+, Header 2 [Str "Fancy",Space,Str "list",Space,Str "markers"]
+, OrderedList (2,Decimal,DefaultDelim)
+ [ [ Plain [Str "begins",Space,Str "with",Space,Str "2"] ]
+ , [ Para [Str "and",Space,Str "now",Space,Str "3"]
+ , Para [Str "with",Space,Str "a",Space,Str "continuation"]
+ , OrderedList (4,LowerRoman,DefaultDelim)
+ [ [ Plain [Str "sublist",Space,Str "with",Space,Str "roman",Space,Str "numerals,",Space,Str "starting",Space,Str "with",Space,Str "4"] ]
+ , [ Plain [Str "more",Space,Str "items"]
+ , OrderedList (1,UpperAlpha,DefaultDelim)
+ [ [ Plain [Str "a",Space,Str "subsublist"] ]
+ , [ Plain [Str "a",Space,Str "subsublist"] ] ] ] ] ] ]
+, Para [Str "Nesting:"]
+, OrderedList (1,UpperAlpha,DefaultDelim)
+ [ [ Plain [Str "Upper",Space,Str "Alpha"]
+ , OrderedList (1,UpperRoman,DefaultDelim)
+ [ [ Plain [Str "Upper",Space,Str "Roman."]
+ , OrderedList (6,Decimal,DefaultDelim)
+ [ [ Plain [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"]
+ , OrderedList (3,LowerAlpha,DefaultDelim)
+ [ [ Plain [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"] ]
+ ] ] ] ] ] ] ]
+, Para [Str "Autonumbering:"]
+, OrderedList (1,DefaultStyle,DefaultDelim)
+ [ [ Plain [Str "Autonumber."] ]
+ , [ Plain [Str "More."]
+ , OrderedList (1,DefaultStyle,DefaultDelim)
+ [ [ Plain [Str "Nested."] ]
+ ] ] ]
+, HorizontalRule
, Header 2 [Str "Definition"]
, DefinitionList
[ ([Str "Violin"],
diff --git a/tests/rst-reader.native b/tests/rst-reader.native
index c5f1f87d2..948c04be5 100644
--- a/tests/rst-reader.native
+++ b/tests/rst-reader.native
@@ -27,7 +27,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
, Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote",Str ":"]
, CodeBlock "sub status {\n print \"working\";\n}"
, Para [Str "List",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote",Str ":"]
- , OrderedList
+ , OrderedList (1,Decimal,Period)
[ [ Plain [Str "item",Space,Str "one"] ]
, [ Plain [Str "item",Space,Str "two"] ] ]
, Para [Str "Nested",Space,Str "block",Space,Str "quotes",Str ":"]
@@ -76,27 +76,27 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
, [ Para [Str "Minus",Space,Str "3"] ] ]
, Header 2 [Str "Ordered"]
, Para [Str "Tight",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Plain [Str "First"] ]
, [ Plain [Str "Second"] ]
, [ Plain [Str "Third"] ] ]
, Para [Str "and",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Plain [Str "One"] ]
, [ Plain [Str "Two"] ]
, [ Plain [Str "Three"] ] ]
, Para [Str "Loose",Space,Str "using",Space,Str "tabs",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Para [Str "First"] ]
, [ Para [Str "Second"] ]
, [ Para [Str "Third"] ] ]
, Para [Str "and",Space,Str "using",Space,Str "spaces",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Para [Str "One"] ]
, [ Para [Str "Two"] ]
, [ Para [Str "Three"] ] ]
, Para [Str "Multiple",Space,Str "paragraphs",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."]
, Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog's",Space,Str "back."] ], [ Para [Str "Item",Space,Str "2."] ]
, [ Para [Str "Item",Space,Str "3."] ] ]
@@ -109,7 +109,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
[ [ Plain [Str "Tab"] ]
] ] ] ] ]
, Para [Str "Here's",Space,Str "another",Str ":"]
-, OrderedList
+, OrderedList (1,Decimal,Period)
[ [ Para [Str "First"] ]
, [ Para [Str "Second",Str ":"]
, BlockQuote
@@ -117,6 +117,34 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
[ [ Plain [Str "Fee"] ]
, [ Plain [Str "Fie"] ]
, [ Plain [Str "Foe"] ] ] ] ], [ Para [Str "Third"] ] ]
+, Header 2 [Str "Fancy",Space,Str "list",Space,Str "markers"]
+, OrderedList (2,Decimal,TwoParens)
+ [ [ Plain [Str "begins",Space,Str "with",Space,Str "2"] ]
+ , [ Para [Str "and",Space,Str "now",Space,Str "3"]
+ , Para [Str "with",Space,Str "a",Space,Str "continuation"]
+ , OrderedList (4,LowerRoman,Period)
+ [ [ Plain [Str "sublist",Space,Str "with",Space,Str "roman",Space,Str "numerals,",Space,Str "starting",Space,Str "with",Space,Str "4"] ]
+ , [ Para [Str "more",Space,Str "items"]
+ , OrderedList (1,UpperAlpha,TwoParens)
+ [ [ Plain [Str "a",Space,Str "subsublist"] ]
+ , [ Plain [Str "a",Space,Str "subsublist"] ] ] ] ] ] ]
+, Para [Str "Nesting",Str ":"]
+, OrderedList (1,UpperAlpha,Period)
+ [ [ Para [Str "Upper",Space,Str "Alpha"]
+ , OrderedList (1,UpperRoman,Period)
+ [ [ Para [Str "Upper",Space,Str "Roman."]
+ , OrderedList (6,Decimal,TwoParens)
+ [ [ Para [Str "Decimal",Space,Str "start",Space,Str "with",Space,Str "6"]
+ , OrderedList (3,LowerAlpha,OneParen)
+ [ [ Plain [Str "Lower",Space,Str "alpha",Space,Str "with",Space,Str "paren"] ]
+ ] ] ] ] ] ] ]
+, Para [Str "Autonumbering",Str ":"]
+, OrderedList (1,DefaultStyle,DefaultDelim)
+ [ [ Plain [Str "Autonumber."] ]
+ , [ Para [Str "More."]
+ , OrderedList (1,DefaultStyle,DefaultDelim)
+ [ [ Plain [Str "Nested."] ]
+ ] ] ]
, Header 2 [Str "Definition"]
, DefinitionList
[ ([Str "term",Space,Str "1"],
diff --git a/tests/rst-reader.rst b/tests/rst-reader.rst
index a31c14b3a..36fd4ff9d 100644
--- a/tests/rst-reader.rst
+++ b/tests/rst-reader.rst
@@ -211,6 +211,37 @@ Here's another:
3. Third
+Fancy list markers
+------------------
+
+(2) begins with 2
+(3) and now 3
+
+ with a continuation
+
+ iv. sublist with roman numerals, starting with 4
+ v. more items
+
+ (A) a subsublist
+ (B) a subsublist
+
+Nesting:
+
+A. Upper Alpha
+
+ I. Upper Roman.
+
+ (6) Decimal start with 6
+
+ c) Lower alpha with paren
+
+Autonumbering:
+
+#. Autonumber.
+#. More.
+
+ #. Nested.
+
Definition
----------
diff --git a/tests/s5.basic.html b/tests/s5.basic.html
index eb4b4e106..bcee42175 100644
--- a/tests/s5.basic.html
+++ b/tests/s5.basic.html
@@ -1,4 +1,4 @@
-
+
+
+
A list:
-
+
item one
@@ -138,7 +138,7 @@ sub status {
-
+
do laundry
@@ -321,7 +321,7 @@ These should not be escaped: \$ \\ \> \[ \{
Tight:
-
+
First
@@ -341,7 +341,7 @@ These should not be escaped: \$ \\ \> \[ \{
and:
-
+
One
@@ -361,7 +361,7 @@ These should not be escaped: \$ \\ \> \[ \{
Loose using tabs:
-
+
First
@@ -381,7 +381,7 @@ These should not be escaped: \$ \\ \> \[ \{
and using spaces:
-
+
One
@@ -401,7 +401,7 @@ These should not be escaped: \$ \\ \> \[ \{
Multiple paragraphs:
-
+
Item 1, graf one.
@@ -449,7 +449,7 @@ These should not be escaped: \$ \\ \> \[ \{
Here's another:
-
+
First
@@ -486,7 +486,7 @@ These should not be escaped: \$ \\ \> \[ \{
Same thing but with paragraphs:
-
+
First
@@ -548,6 +548,101 @@ These should not be escaped: \$ \\ \> \[ \{
+
+ Fancy list markers
+
+
+
+ begins with 2
+
+
+
+
+ and now 3
+
+
+ with a continuation
+
+
+
+
+ sublist with roman numerals, starting with 4
+
+
+
+
+ more items
+
+
+
+
+ a subsublist
+
+
+
+
+ a subsublist
+
+
+
+
+
+
+
+
+ Nesting:
+
+
+
+
+ Upper Alpha
+
+
+
+
+ Upper Roman.
+
+
+
+
+ Decimal start with 6
+
+
+
+
+ Lower alpha with paren
+
+
+
+
+
+
+
+
+
+
+ Autonumbering:
+
+
+
+
+ Autonumber.
+
+
+
+
+ More.
+
+
+
+
+ Nested.
+
+
+
+
+
+
Definition Lists
@@ -1158,7 +1253,7 @@ or here: <http://example.com/>
-
+
And in list
diff --git a/tests/writer.html b/tests/writer.html
index 6f24e511a..6c3637315 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -1,4 +1,4 @@
-
+
+.strikeout { text-decoration: line-through; }
+ol.decimal { list-style-type: decimal; }
+ol.lower-alpha { list-style-type: lower-alpha; }
+ol.lower-roman { list-style-type: lower-roman; }
+ol.upper-alpha { list-style-type: upper-alpha; }
+ol.upper-roman { list-style-type: upper-roman; }
+A list:
- item one
- do laundry
- Ordered
Tight:
- First
and:
- One
Loose using tabs:
First
and using spaces:
One
Multiple paragraphs:
Item 1, graf one.
Here’s another:
- First
Same thing but with paragraphs:
First
Fancy list markers
- begins with 2
and now 3
with a continuation
- sublist with roman numerals, starting with 4
- more items
- a subsublist
- a subsublist
Nesting:
- Upper Alpha
- Upper Roman.
- Decimal start with 6
- Lower alpha with paren
Autonumbering:
- Autonumber.
- More.
- Nested.
Definition Lists
'+''+e+'
'+'<\/'+
>
- And in list items.