diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-19 11:55:09 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-19 11:55:09 +0000 |
commit | f35ac0a9e947118688363c27bc92f450896a6c32 (patch) | |
tree | 7b46567fcc347e180644e9812bb8415cf361861b /bbcode | |
parent | 4392dd7726cdbe82b9d22f10199b102704bad5fc (diff) | |
download | thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.gz thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.bz2 thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.tar.xz thermoprint-f35ac0a9e947118688363c27bc92f450896a6c32.zip |
Fixed handling for paragraphs at toplevel
Diffstat (limited to 'bbcode')
-rw-r--r-- | bbcode/src/Text/BBCode.hs | 2 |
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 | ||