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.
This commit is contained in:
parent
f232a0a720
commit
3564cd82ca
1 changed files with 2 additions and 2 deletions
|
@ -524,8 +524,8 @@ instance Default DBState where
|
|||
|
||||
readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
|
||||
readDocBook _ inp = (\blocks -> Pandoc (dbMeta st') (toList . mconcat $ blocks)) <$> bs
|
||||
where (bs , st') = flip runState def . runExceptT . mapM parseBlock . normalizeTree . parseXML $ inp'
|
||||
inp' = handleInstructions inp
|
||||
where (bs , st') = flip runState def . runExceptT . mapM parseBlock $ tree
|
||||
tree = normalizeTree . parseXML . handleInstructions $ inp
|
||||
|
||||
-- We treat <?asciidoc-br?> specially (issue #1236), converting it
|
||||
-- to <br/>, since xml-light doesn't parse the instruction correctly.
|
||||
|
|
Loading…
Add table
Reference in a new issue