From bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 18 Jan 2016 07:03:17 +0000 Subject: HSpace & VSpace now ignore children instead of failing --- spec/src/Thermoprint/Printout/BBCode.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/src/Thermoprint/Printout/BBCode.hs b/spec/src/Thermoprint/Printout/BBCode.hs index fa9d892..33101e5 100644 --- a/spec/src/Thermoprint/Printout/BBCode.hs +++ b/spec/src/Thermoprint/Printout/BBCode.hs @@ -119,9 +119,9 @@ parse :: Monoid a => Context a -> [DomTree] -> Either SemanticError a parse ctx = mergeResult ctx . map parseDom asBlock :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Block -asBlock "VSpace" [] = Right . VSpace . lookupAttr "height" 1 +asBlock "VSpace" _ = Right . VSpace . lookupAttr "height" 1 asBlock t _ = const $ Left . UnmappedBlockElement . CI.original $ t asLine :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Line -asLine "HSpace" [] = Right . HSpace . lookupAttr "width" 1 +asLine "HSpace" _ = Right . HSpace . lookupAttr "width" 1 asLine t _ = const $ Left . UnmappedLineElement . CI.original $ t -- cgit v1.2.3