git.iko.soy/typeable/pandoc
on master help sign in
Org reader: fix planning elements in headers level 3 and higher

Planning info is now always placed before the subtree contents. Previously, the planning info was placed after the content if the header's subtree was converted to a list, which happens with headers of level 3 and higher per default. Fixes: #5494

commit8b00bc6029b9285f872ae517a8d4538c66070fa9 authorAlbert Krewinkel <albert@zeitkraut.de> dateMon 13 May 2019, 22:44 (7 years ago) parent00ef038
2 files changed+25−1
src/Text/Pandoc/Readers/Org/DocumentTree.hs+1−1 test/Tests/Readers/Org/Block/Header.hs+24
src/Text/Pandoc/Readers/Org/DocumentTree.hs+1−1
@@ -235,8 +235,8 @@ headlineToHeaderWithList hdln = do
235235 else flattenHeader header
236236 return . mconcat $
237237 [ headerText
238− , headlineContents hdln
239238 , planningBlock
239+ , headlineContents hdln
240240 , listBlock
241241 ]
242242 where
test/Tests/Readers/Org/Block/Header.hs+24
@@ -236,5 +236,29 @@ tests =
236236 , " :END:"
237237 ] =?>
238238 headerWith ("look", [], []) 1 "important"
239+
240+ , "third and forth level headers" =:
241+ T.unlines [ "#+OPTIONS: p:t h:3"
242+ , "*** Third"
243+ , " CLOSED: [2018-09-05 Wed 13:58]"
244+ , " Text 3"
245+ , "**** Fourth"
246+ , "SCHEDULED: <2019-05-13 Mon 22:42>"
247+ , "Text 4"
248+ ] =?>
249+ mconcat
250+ [ headerWith ("third", [], mempty) 3 "Third"
251+ , plain $
252+ strong "CLOSED:" <> space <> emph (str "[2018-09-05 Wed 13:58]")
253+ , para "Text 3"
254+ , orderedList [
255+ mconcat
256+ [ para "Fourth"
257+ , plain $ strong "SCHEDULED:"
258+ <> space
259+ <> emph (str "<2019-05-13 Mon 22:42>")
260+ , para "Text 4"
261+ ]]
262+ ]
239263 ]
240264 ]