From 2f7780b552e11fb1645c628e1fd17158672b3ad8 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 11 Apr 2008 13:24:57 +0200 Subject: [PATCH] better error messages for invalid xhtml * tekuti/filters.scm (bad-user-submitted-xhtml?): Add a more informative error message. --- tekuti/filters.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tekuti/filters.scm b/tekuti/filters.scm index d7b914b..eaa37dd 100644 --- a/tekuti/filters.scm +++ b/tekuti/filters.scm @@ -149,8 +149,17 @@ `(div (p "Invalid XHTML") ,(case key ((parser-error) - `(pre ,(with-output-to-string - (lambda () (write args))))) + `(div + (p "The comment filter requires valid XHTML, although " + "it will translate single newlines to
elements, " + "and multiple newlines to paragraphs.") + (p "Usually if you get here it's because you put in a " + "malformed XHTML tag. Another way to get here is if " + "you have an unescaped <, >, or & character. Replace " + "them with <, >, or &, respectively.") + (p "Here is the internal error:") + (pre ,(with-output-to-string + (lambda () (write args)))))) ((bad-tag) `(p "XHTML tag disallowed: " ,(symbol->string (car args)))) ((bad-attr)