Update of /project/lisppaste/cvsroot/lisppaste2 In directory common-lisp.net:/tmp/cvs-serv14987
Modified Files: encode-for-pre.lisp web-server.lisp Log Message: Use encode-for-tt and <tt>
Date: Wed Nov 12 00:58:56 2003 Author: bmastenbrook
Index: lisppaste2/encode-for-pre.lisp diff -u lisppaste2/encode-for-pre.lisp:1.1.1.1 lisppaste2/encode-for-pre.lisp:1.2 --- lisppaste2/encode-for-pre.lisp:1.1.1.1 Mon Nov 3 12:17:53 2003 +++ lisppaste2/encode-for-pre.lisp Wed Nov 12 00:58:56 2003 @@ -1,4 +1,4 @@ -;;;; $Id: encode-for-pre.lisp,v 1.1.1.1 2003/11/03 17:17:53 eenge Exp $ +;;;; $Id: encode-for-pre.lisp,v 1.2 2003/11/12 05:58:56 bmastenbrook Exp $ ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/encode-for-pre.lisp,v $
;;;; See the LICENSE file for licensing information. @@ -21,4 +21,9 @@ (defun encode-for-pre (str) (replace-in-string (replace-in-string - (replace-in-string str #& "&") #< "<") #> ">")) \ No newline at end of file + (replace-in-string str #& "&") #< "<") #> ">")) + +(defun encode-for-tt (str) + (replace-in-string + (replace-in-string + (replace-in-string str #\newline "") #\return "<br>") #\linefeed "")) \ No newline at end of file
Index: lisppaste2/web-server.lisp diff -u lisppaste2/web-server.lisp:1.12 lisppaste2/web-server.lisp:1.13 --- lisppaste2/web-server.lisp:1.12 Wed Nov 12 00:43:11 2003 +++ lisppaste2/web-server.lisp Wed Nov 12 00:58:56 2003 @@ -1,4 +1,4 @@ -;;;; $Id: web-server.lisp,v 1.12 2003/11/12 05:43:11 bmastenbrook Exp $ +;;;; $Id: web-server.lisp,v 1.13 2003/11/12 05:58:56 bmastenbrook Exp $ ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/web-server.lisp,v $
;;;; See the LICENSE file for licensing information. @@ -189,16 +189,16 @@ (title "Paste number " ,paste-number)) (body ((table :width "100%" :cellpadding 2) - (tr ((td :align "left" :nowrap) "Paste number " ,paste-number ": ") - ((td :width "100%" :align "left") (b ,(encode-for-pre (paste-title paste))))) + (tr ((td :align "left" :width "0%" :nowrap) "Paste number " ,paste-number ": ") + ((td :align "left" :width "100%") (b ,(encode-for-pre (paste-title paste))))) (tr ((td :align "left" :nowrap) "Pasted by: ") - ((td :width "100%" :align "left") ,(encode-for-pre (paste-user paste)))) + ((td :align "left" :width "100%") ,(encode-for-pre (paste-user paste)))) (tr (td) - ((td :width "100%" :align "left") ,(time-delta (paste-universal-time paste)))) + ((td :align "left" :width "100%") ,(time-delta (paste-universal-time paste)))) (tr ((td :align "left" :valign "top" :nowrap) "Paste contents:") - (td)) + ((td :width "100%"))) (tr (td (p))) - (tr ((td :bgcolor "#F4F4F4" :colspan 2 :width "100%") (pre ,(encode-for-pre (paste-contents paste))))) + (tr ((td :bgcolor "#F4F4F4" :colspan 2 :width "100%") (tt ,(encode-for-tt (paste-contents paste))))) ,@(if (paste-annotations paste) `((tr (td (p)) (td)) (tr ((th :align "left" :colspan 2) "Annotations for this paste: ")) @@ -216,7 +216,7 @@ ((td :align "left") ,(time-delta (paste-universal-time a)))) (tr ((td :valign "top" :nowrap) "Annotation contents:") - ((td :bgcolor "#F4F4F4" :width "100%") (pre ,(encode-for-pre (paste-contents a))))))) + ((td :bgcolor "#F4F4F4" :width "100%") (tt ,(encode-for-tt (paste-contents a))))))) (paste-annotations paste)))) `((tr (td (p)) (td)) (tr ((td :align "left" :colspan 2 :nowrap) "This paste has no annotations.")))))