, bCmdAttributes = tagAttrs
, bCmdContents = xs
}
- _ -> pzero
+
+ Just InlineCommandType
+ -> pzero
+
+ _ -> return $ undefinedCmdErr tagName
)
<|>
(try $ do (tagName, tagAttrs) <- emptyTag
, bCmdAttributes = tagAttrs
, bCmdContents = []
}
- _ -> pzero
+
+ Just InlineCommandType
+ -> pzero
+
+ _ -> return $ undefinedCmdErr tagName
)
<?>
"block command"
<|>
return []
+ undefinedCmdErr :: String -> BlockElement
+ undefinedCmdErr name
+ = Div [("class", "error")]
+ [ Paragraph [Text ("The command `" ++ name ++ "' is not defined. " ++
+ "Ensure that you haven't mistyped and the module " ++
+ "providing the command is actually loaded.")
+ ]
+ ]
+
inlineElement :: CommandTypeOf -> Parser InlineElement
inlineElement cmdTypeOf