git.iko.soy/typeable/pandoc
on master help sign in
Docx reader tests: test custom style extension.
ffcecfaJesse Rosenthal
test/Tests/Readers/Docx.hs+11
@@ -372,6 +372,17 @@ tests = [ testGroup "inlines"
372 "image extraction"
372 "image extraction"
373 "docx/image.docx"
373 "docx/image.docx"
374 ]
374 ]
375+ , testGroup "custom styles"
376+ [ testCompare
377+ "custom styles (`+styles`) not enabled (default)"
378+ "docx/custom-style-reference.docx"
379+ "docx/custom-style-no-styles.native"
380+ , testCompareWithOpts
381+ def{readerExtensions=extensionsFromList [Ext_styles]}
382+ "custom styles (`+styles`) enabled"
383+ "docx/custom-style-reference.docx"
384+ "docx/custom-style-with-styles.native"
385+ ]
375 , testGroup "metadata"
386 , testGroup "metadata"
376 [ testCompareWithOpts def{readerStandalone=True}
387 [ testCompareWithOpts def{readerStandalone=True}
377 "metadata fields"
388 "metadata fields"
test/docx/custom-style-no-styles.nativenew file+4
@@ -0,0 +1,4 @@
1+[Para [Str "This",Space,Str "is",Space,Str "some",Space,Str "text."]
2+,Para [Str "This",Space,Str "is",Space,Str "text",Space,Str "with",Space,Str "an",Space,Emph [Str "emphasized"],Space,Str "text",Space,Str "style.",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "text",Space,Str "with",Space,Str "a",Space,Strong [Str "strengthened"],Space,Str "text",Space,Str "style."]
3+,BlockQuote
4+ [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "styled",Space,Str "paragraph",Space,Str "that",Space,Str "inherits",Space,Str "from",Space,Str "Block",Space,Str "Text."]]]
test/docx/custom-style-with-styles.nativenew file+7
@@ -0,0 +1,7 @@
1+[Div ("",[],[("custom-style","FirstParagraph")])
2+ [Para [Str "This",Space,Str "is",Space,Str "some",Space,Str "text."]]
3+,Div ("",[],[("custom-style","BodyText")])
4+ [Para [Str "This",Space,Str "is",Space,Str "text",Space,Str "with",Space,Str "an",Space,Emph [Span ("",[],[("custom-style","Emphatic")]) [Span ("",[],[("custom-style","Emphatic")]) [Str "emphasized"]]],Space,Str "text",Space,Str "style.",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "text",Space,Str "with",Space,Str "a",Space,Strong [Span ("",[],[("custom-style","Strengthened")]) [Span ("",[],[("custom-style","Strengthened")]) [Str "strengthened"]]],Space,Str "text",Space,Str "style."]]
5+,Div ("",[],[("custom-style","MyBlockStyle")])
6+ [BlockQuote
7+ [Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "styled",Space,Str "paragraph",Space,Str "that",Space,Str "inherits",Space,Str "from",Space,Str "Block",Space,Str "Text."]]]]