[cl-who-devel] script tag

Hello, I think I found a bug in cl-who. The following sample code: (defun script-bug () (with-html-output-to-string (*standard-output* nil :indent t) (:html (:head (:script :src "/myscript.js" :type "text/javascript")) (:body (:p "Some text") (:script :type "text/javascript" "alert(5);"))))) gives: " <html> <head> <script src='/myscript.js' type='text/javascript' /> </head> <body> <p> Some text </p> <script type='text/javascript'> alert(5); </script> </body> </html>" The first script tag is not closed properly. It should be: <script src='/myscript.js' type='text/javascript'></script> If I get this right, this happens because there are no <script> contents. But the ending </script> must not be omitted even in this case. This seems to prevent correct parsing of the document. Cheers, Giorgos

Hi, On Thu, 8 Mar 2007 23:32:10 +0200, Giorgos Pontikakis <gnp@freemail.gr> wrote:
I think I found a bug in cl-who. The following sample code:
(defun script-bug () (with-html-output-to-string (*standard-output* nil :indent t) (:html (:head (:script :src "/myscript.js" :type "text/javascript")) (:body (:p "Some text") (:script :type "text/javascript" "alert(5);")))))
gives:
" <html> <head> <script src='/myscript.js' type='text/javascript' /> </head> <body> <p> Some text </p> <script type='text/javascript'> alert(5); </script> </body> </html>"
The first script tag is not closed properly. It should be: <script src='/myscript.js' type='text/javascript'></script>
If I get this right, this happens because there are no <script> contents. But the ending </script> must not be omitted even in this case. This seems to prevent correct parsing of the document.
The tag /is/ closed correctly. Note that there's a difference between <script src='/myscript.js' type='text/javascript' /> and <script src='/myscript.js' type='text/javascript'>. Do you have a concrete application that can't parse this? Cheers, Edi.

Could be this: http://piecesofrakesh.blogspot.com/2005/03/script-tag-in-internet-explorer.h... Erik. On 3/8/07, Edi Weitz <edi@agharta.de> wrote:
Hi,
On Thu, 8 Mar 2007 23:32:10 +0200, Giorgos Pontikakis <gnp@freemail.gr> wrote:
I think I found a bug in cl-who. The following sample code:
(defun script-bug () (with-html-output-to-string (*standard-output* nil :indent t) (:html (:head (:script :src "/myscript.js" :type "text/javascript")) (:body (:p "Some text") (:script :type "text/javascript" "alert(5);")))))
gives:
" <html> <head> <script src='/myscript.js' type='text/javascript' /> </head> <body> <p> Some text </p> <script type='text/javascript'> alert(5); </script> </body> </html>"
The first script tag is not closed properly. It should be: <script src='/myscript.js' type='text/javascript'></script>
If I get this right, this happens because there are no <script> contents. But the ending </script> must not be omitted even in this case. This seems to prevent correct parsing of the document.
The tag /is/ closed correctly. Note that there's a difference between
<script src='/myscript.js' type='text/javascript' />
and
<script src='/myscript.js' type='text/javascript'>.
Do you have a concrete application that can't parse this?
Cheers, Edi.
_______________________________________________ cl-who-devel site list cl-who-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/cl-who-devel

On Thu, 8 Mar 2007 17:03:50 -0500, "Erik Enge" <erik.enge@gmail.com> wrote:
http://piecesofrakesh.blogspot.com/2005/03/script-tag-in-internet-explorer.h...
Ah, interesting, thanks. So, you should better use (:SCRIPT "") then to avoid that.
participants (3)
-
Edi Weitz
-
Erik Enge
-
Giorgos Pontikakis