From 0ebe65e651766a2b3d006d3dee4afdfd43a386d5 Mon Sep 17 00:00:00 2001 From: Emily Bourke Date: Wed, 8 Sep 2021 14:05:22 +0100 Subject: pptx: Fix logic for choosing Comparison layout There was a mistake in the logic used to choose between the Comparison and Two Content layouts: if one column contained only non-text (an image or a table) and the other contained only text, the Comparison layout was chosen instead of the desired Two Content layout. This commit fixes that logic: > If either column contains text followed by non-text, use Comparison. Otherwise, use Two Content. It also adds a test asserting this behaviour. --- test/pptx/two-column/all-text/input.native | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/pptx/two-column/all-text/input.native (limited to 'test/pptx/two-column/all-text/input.native') diff --git a/test/pptx/two-column/all-text/input.native b/test/pptx/two-column/all-text/input.native new file mode 100644 index 000000000..086f74889 --- /dev/null +++ b/test/pptx/two-column/all-text/input.native @@ -0,0 +1,9 @@ +Pandoc (Meta {unMeta = fromList []}) +[Header 1 ("two-column-layout",[],[]) [Str "Two-Column",Space,Str "Layout"] +,Div ("",["columns"],[]) + [Div ("",["column"],[]) + [Para [Str "One",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "paragraph."]] + ,Div ("",["column"],[]) + [Para [Str "Second",Space,Str "column",Space,Str "paragraph."] + ,Para [Str "Another",Space,Str "second",Space,Str "paragraph."]]]] -- cgit v1.2.3