git.iko.soy/typeable/pandoc
on master help sign in
Minor refactoring to readDocBook

I plan to use the parsed and normalized XML tree read in readDocBook in other places - prepare that commit by factoring this code out into a separate, shared, definition.

commit3564cd82caf81763f83897bdd144c833ffab58ee authorFrerich Raabe <raabe@froglogic.com> dateWed 23 Sep 2015, 19:25 (11 years ago) parentf232a0a
1 file changed+2−2
src/Text/Pandoc/Readers/DocBook.hs+2−2
src/Text/Pandoc/Readers/DocBook.hs+2−2
@@ -524,8 +524,8 @@ instance Default DBState where
524524
525525readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
526526readDocBook _ inp = (\blocks -> Pandoc (dbMeta st') (toList . mconcat $ blocks)) <$> bs
527− where (bs , st') = flip runState def . runExceptT . mapM parseBlock . normalizeTree . parseXML $ inp'
528− inp' = handleInstructions inp
527+ where (bs , st') = flip runState def . runExceptT . mapM parseBlock $ tree
528+ tree = normalizeTree . parseXML . handleInstructions $ inp
529529
530530-- We treat <?asciidoc-br?> specially (issue #1236), converting it
531531-- to <br/>, since xml-light doesn't parse the instruction correctly.