aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-19 11:55:09 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-19 11:55:09 +0000
commitf35ac0a9e947118688363c27bc92f450896a6c32 (patch)
tree7b46567fcc347e180644e9812bb8415cf361861b
parent4392dd7726cdbe82b9d22f10199b102704bad5fc (diff)
downloadthermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar
thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.gz
thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.bz2
thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.xz
thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.zip
Fixed handling for paragraphs at toplevel
-rw-r--r--bbcode/src/Text/BBCode.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/bbcode/src/Text/BBCode.hs b/bbcode/src/Text/BBCode.hs
index f3c9ca2..d0c9974 100644
--- a/bbcode/src/Text/BBCode.hs
+++ b/bbcode/src/Text/BBCode.hs
@@ -127,6 +127,8 @@ rose = fmap Z.toForest . checkClosure <=< foldM (flip rose') (Z.fromForest [])
127 siblingsAsPars 127 siblingsAsPars
128 | all isPar siblings = Right z 128 | all isPar siblings = Right z
129 | Z.isRoot z = Right . Z.fromForest $ [Node BBPar siblings] 129 | Z.isRoot z = Right . Z.fromForest $ [Node BBPar siblings]
130 | (Just p) <- Z.parent z
131 , BBPar <- Z.label p = Right . Z.nextSpace $ p
130 | otherwise = Left ParagraphWithinTag 132 | otherwise = Left ParagraphWithinTag
131 in Z.children . Z.insert (Node BBPar []) . Z.last <$> siblingsAsPars 133 in Z.children . Z.insert (Node BBPar []) . Z.last <$> siblingsAsPars
132 134