From f35ac0a9e947118688363c27bc92f450896a6c32 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 19 Jan 2016 11:55:09 +0000 Subject: Fixed handling for paragraphs at toplevel --- bbcode/src/Text/BBCode.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bbcode/src') 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 []) siblingsAsPars | all isPar siblings = Right z | Z.isRoot z = Right . Z.fromForest $ [Node BBPar siblings] + | (Just p) <- Z.parent z + , BBPar <- Z.label p = Right . Z.nextSpace $ p | otherwise = Left ParagraphWithinTag in Z.children . Z.insert (Node BBPar []) . Z.last <$> siblingsAsPars -- cgit v1.2.3