]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Wiki/Parser.hs
Record before creating Rakka-Base.
[Rakka.git] / Rakka / Wiki / Parser.hs
index e2e39261929c4fcd37ddde176b1c22f9ec36e59e..6c5d20722c89f8243b8accc45fe193d771b33f8b 100644 (file)
@@ -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