X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FWiki%2FParser.hs;h=6c5d20722c89f8243b8accc45fe193d771b33f8b;hp=e2e39261929c4fcd37ddde176b1c22f9ec36e59e;hb=4e8a07033b0b0ea0961bffb3bab0b6fc9c21afba;hpb=0b1235464affca4fb349c713278d2e37fd8e9584 diff --git a/Rakka/Wiki/Parser.hs b/Rakka/Wiki/Parser.hs index e2e3926..6c5d207 100644 --- a/Rakka/Wiki/Parser.hs +++ b/Rakka/Wiki/Parser.hs @@ -233,7 +233,11 @@ blockCmd cmdTypeOf , bCmdAttributes = tagAttrs , bCmdContents = xs } - _ -> pzero + + Just InlineCommandType + -> pzero + + _ -> return $ undefinedCmdErr tagName ) <|> (try $ do (tagName, tagAttrs) <- emptyTag @@ -244,7 +248,11 @@ blockCmd cmdTypeOf , bCmdAttributes = tagAttrs , bCmdContents = [] } - _ -> pzero + + Just InlineCommandType + -> pzero + + _ -> return $ undefinedCmdErr tagName ) "block command" @@ -260,6 +268,15 @@ blockCmd cmdTypeOf <|> 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