aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-18 07:03:17 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-18 07:03:17 +0000
commitbc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c (patch)
tree7eddb5805e14b761a2545396e8c2679c9183098d /spec
parent2bbaf2540cd30cb608f53114cced144b2083ddd8 (diff)
downloadthermoprint-bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c.tar
thermoprint-bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c.tar.gz
thermoprint-bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c.tar.bz2
thermoprint-bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c.tar.xz
thermoprint-bc956b6977019fb55cac94bf5bc4ab0ae4fe7e2c.zip
HSpace & VSpace now ignore children
instead of failing
Diffstat (limited to 'spec')
-rw-r--r--spec/src/Thermoprint/Printout/BBCode.hs4
1 files 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
119parse ctx = mergeResult ctx . map parseDom 119parse ctx = mergeResult ctx . map parseDom
120 120
121asBlock :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Block 121asBlock :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Block
122asBlock "VSpace" [] = Right . VSpace . lookupAttr "height" 1 122asBlock "VSpace" _ = Right . VSpace . lookupAttr "height" 1
123asBlock t _ = const $ Left . UnmappedBlockElement . CI.original $ t 123asBlock t _ = const $ Left . UnmappedBlockElement . CI.original $ t
124 124
125asLine :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Line 125asLine :: CI Text -> [DomTree] -> Map (CI Text) Text -> Either SemanticError Line
126asLine "HSpace" [] = Right . HSpace . lookupAttr "width" 1 126asLine "HSpace" _ = Right . HSpace . lookupAttr "width" 1
127asLine t _ = const $ Left . UnmappedLineElement . CI.original $ t 127asLine t _ = const $ Left . UnmappedLineElement . CI.original $ t