1
0
Fork 0

inform the user of malformed xhtml internal error when publishing

This commit is contained in:
Aleix Conchillo Flaque 2010-12-23 17:41:09 +01:00 committed by Andy Wingo
parent 0dee43b2a0
commit 612577eca9
2 changed files with 7 additions and 6 deletions

View file

@ -146,18 +146,19 @@
(pre-post-order (wordpress->sxml x) *valid-xhtml-rules*) (pre-post-order (wordpress->sxml x) *valid-xhtml-rules*)
#f) #f)
(lambda (key . args) (lambda (key . args)
`(div (p "Invalid XHTML") `(div (p (b "Invalid XHTML"))
,(case key ,(case key
((parser-error) ((parser-error)
`(div `(div
(p "The comment filter requires valid XHTML, although " (p "Valid XHTML is required, although it will "
"it will translate single newlines to <br/> elements, " "translate single newlines to <br/> elements, "
"and multiple newlines to paragraphs.") "and multiple newlines to paragraphs.")
(p "Usually if you get here it's because you put in a " (p "Usually if you get here it's because you put in a "
"malformed XHTML tag. Another way to get here is if " "malformed XHTML tag.")
(p "Another way to get here is if "
"you have an unescaped <, >, or & character. Replace " "you have an unescaped <, >, or & character. Replace "
"them with &lt;, &gt;, or &amp;, respectively.") "them with &lt;, &gt;, or &amp;, respectively.")
(p "Here is the internal error:") (p (b "Here is the internal error:"))
(pre ,(with-output-to-string (pre ,(with-output-to-string
(lambda () (write args)))))) (lambda () (write args))))))
((bad-tag) ((bad-tag)

View file

@ -113,7 +113,7 @@
((wordpress) (wordpress->sxml raw)) ((wordpress) (wordpress->sxml raw))
(else `(pre ,raw)))) (else `(pre ,raw))))
(lambda args (lambda args
`(pre "Formatting error\n" ,raw))))) `(pre ,(bad-user-submitted-xhtml? raw))))))
(define (post-readable-date post) (define (post-readable-date post)
(let ((date (time-utc->date (let ((date (time-utc->date