Odt: Add list-header
The list-header is a type of list-item. Therefore, it will be treated exactly like one.
This commit is contained in:
parent
808bcb5d3b
commit
32297d5677
6 changed files with 146 additions and 7 deletions
|
@ -661,16 +661,23 @@ read_list = matchingElement NsText "list"
|
|||
$ constructList
|
||||
-- $ liftA bulletList
|
||||
$ matchChildContent' [ read_list_item
|
||||
, read_list_header
|
||||
]
|
||||
--
|
||||
read_list_item :: ElementMatcher [Blocks]
|
||||
read_list_item = matchingElement NsText "list-item"
|
||||
$ liftA (compactify.(:[]))
|
||||
( matchChildContent' [ read_paragraph
|
||||
, read_header
|
||||
, read_list
|
||||
]
|
||||
)
|
||||
read_list_item = read_list_element "list-item"
|
||||
|
||||
read_list_header :: ElementMatcher [Blocks]
|
||||
read_list_header = read_list_element "list-header"
|
||||
|
||||
read_list_element :: ElementName -> ElementMatcher [Blocks]
|
||||
read_list_element listElement = matchingElement NsText listElement
|
||||
$ liftA (compactify.(:[]))
|
||||
( matchChildContent' [ read_paragraph
|
||||
, read_header
|
||||
, read_list
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
----------------------
|
||||
|
|
|
@ -171,6 +171,7 @@ namesOfTestsComparingToNative = [ "blockquote"
|
|||
, "orderedListMixed"
|
||||
, "orderedListRoman"
|
||||
, "orderedListSimple"
|
||||
, "orderedListHeader"
|
||||
, "referenceToChapter"
|
||||
, "referenceToListItem"
|
||||
, "referenceToText"
|
||||
|
@ -182,4 +183,5 @@ namesOfTestsComparingToNative = [ "blockquote"
|
|||
, "tableWithContents"
|
||||
, "unicode"
|
||||
, "unorderedList"
|
||||
, "unorderedListHeader"
|
||||
]
|
||||
|
|
80
test/odt/native/orderedListHeader.native
Normal file
80
test/odt/native/orderedListHeader.native
Normal file
|
@ -0,0 +1,80 @@
|
|||
[ OrderedList
|
||||
( 1 , Decimal , Period )
|
||||
[ [ Plain
|
||||
[ Str "A"
|
||||
, Space
|
||||
, Str "list"
|
||||
, Space
|
||||
, Str "item"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "A" , Space , Str "second" ] ]
|
||||
, [ Para [ Str "A" , Space , Str "third" ]
|
||||
, OrderedList
|
||||
( 1 , Decimal , Period )
|
||||
[ [ Para
|
||||
[ Str "New"
|
||||
, Space
|
||||
, Str "level!"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
, OrderedList
|
||||
( 1 , Decimal , Period )
|
||||
[ [ Plain
|
||||
[ Str "And"
|
||||
, Space
|
||||
, Str "another!"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "It's"
|
||||
, Space
|
||||
, Str "great"
|
||||
, Space
|
||||
, Str "up"
|
||||
, Space
|
||||
, Str "here!"
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "Oh" , Space , Str "noes" ] ]
|
||||
, [ Plain [ Str "We" , Space , Str "fell!" ] ]
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "Maybe" , Space , Str "someone" ] ]
|
||||
, [ Plain [ Str "Pushed" , Space , Str "us?" ] ]
|
||||
]
|
||||
, Para []
|
||||
, OrderedList
|
||||
( 4 , Decimal , Period )
|
||||
[ [ Plain
|
||||
[ Str "Start"
|
||||
, Space
|
||||
, Str "new"
|
||||
, Space
|
||||
, Str "list,"
|
||||
, Space
|
||||
, Str "but"
|
||||
, Space
|
||||
, Str "a"
|
||||
, Space
|
||||
, Str "different"
|
||||
, Space
|
||||
, Str "starting"
|
||||
, Space
|
||||
, Str "point."
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "Because" , Space , Str "we" , Space , Str "can." ]
|
||||
]
|
||||
]
|
||||
]
|
50
test/odt/native/unorderedListHeader.native
Normal file
50
test/odt/native/unorderedListHeader.native
Normal file
|
@ -0,0 +1,50 @@
|
|||
[ BulletList
|
||||
[ [ Plain
|
||||
[ Str "A"
|
||||
, Space
|
||||
, Str "list"
|
||||
, Space
|
||||
, Str "item"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "A" , Space , Str "second" ] ]
|
||||
, [ Para [ Str "A" , Space , Str "third" ]
|
||||
, BulletList
|
||||
[ [ Para
|
||||
[ Str "New"
|
||||
, Space
|
||||
, Str "level!"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
, BulletList
|
||||
[ [ Plain
|
||||
[ Str "And"
|
||||
, Space
|
||||
, Str "another!"
|
||||
, Space
|
||||
, Str "(list-header)"
|
||||
]
|
||||
]
|
||||
, [ Plain
|
||||
[ Str "It's"
|
||||
, Space
|
||||
, Str "great"
|
||||
, Space
|
||||
, Str "up"
|
||||
, Space
|
||||
, Str "here!"
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "Oh" , Space , Str "noes" ] ]
|
||||
, [ Plain [ Str "We" , Space , Str "fell!" ] ]
|
||||
]
|
||||
]
|
||||
, [ Plain [ Str "Maybe" , Space , Str "someone" ] ]
|
||||
, [ Plain [ Str "Pushed" , Space , Str "us?" ] ]
|
||||
]
|
||||
]
|
BIN
test/odt/odt/orderedListHeader.odt
Normal file
BIN
test/odt/odt/orderedListHeader.odt
Normal file
Binary file not shown.
BIN
test/odt/odt/unorderedListHeader.odt
Normal file
BIN
test/odt/odt/unorderedListHeader.odt
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue