Discussion:
convert-tag-to-string-list and *html-empty-tag* bug maybe :)
Simon Cusack
2007-05-27 23:41:45 UTC
Permalink
Hi,
From my testing it seems that the default convert-tag-to-string-list
isn't finding the tags in html-empty-tag when it should. It looks like
tag is getting converted to a string but *html-empty-tags* are keywords.

I changed
(member tag *html-empty-tags*)
to
(member tag *html-empty-tags* :test #'string-equal)

and made it happy.

the following test

(in-package :who)
(with-html-output-to-string (blah)
(with-html-output (blah)
(:input :value "test this")
(:div)
(:div "test this")))

Used to produce:
"<input value='test this'></input><div></div><div>test this</div>"

and now produces;
"<input value='test this' /><div></div><div>test this</div>"
Mac Chan
2007-05-28 03:00:02 UTC
Permalink
Hi Simon,
Post by Simon Cusack
I changed
(member tag *html-empty-tags*)
to
(member tag *html-empty-tags* :test #'string-equal)
You're right. It was my bad. The patch that I sent in had this bug.

I was too concern about (:div) producing <div></div> and didn't
manually test the other case.
The browser didn't complain <br></br> :-(

If I unit test this code I should have caught it. Sorry for the inconvience.

Regards,
-- Mac
Simon Cusack
2007-05-28 05:16:41 UTC
Permalink
Hi Mac,

That's cool, we all make em :)

I was also wondering about some of the tags that appear in the
*html-empty-tags* list. Some of them don't appear to be html tags, for
example :limittext :of :spacer, etc.

Should it be a list of tags for html4.0? or xhtml? (off hand I don't
know if that would be the same list or not) or is the intention that I
bind this to the list that is appropriate for me in which case maybe it
should start out as an empty list.

regards, sim


----- Original message -----
From: "Mac Chan" <***@gmail.com>
To: "General interest list about cl-who" <cl-who-***@common-lisp.net>
Date: Sun, 27 May 2007 20:00:02 -0700
Subject: Re: [cl-who-devel] convert-tag-to-string-list and
*html-empty-tag* bug maybe :)

Hi Simon,
Post by Simon Cusack
I changed
(member tag *html-empty-tags*)
to
(member tag *html-empty-tags* :test #'string-equal)
You're right. It was my bad. The patch that I sent in had this bug.

I was too concern about (:div) producing <div></div> and didn't
manually test the other case.
The browser didn't complain <br></br> :-(

If I unit test this code I should have caught it. Sorry for the
inconvience.

Regards,
-- Mac
Mac Chan
2007-05-28 05:27:28 UTC
Permalink
Post by Simon Cusack
I was also wondering about some of the tags that appear in the
*html-empty-tags* list. Some of them don't appear to be html tags, for
example :limittext :of :spacer, etc.
I copied the tags from a javascript library (I forget which).
Post by Simon Cusack
Should it be a list of tags for html4.0? or xhtml? (off hand I don't
know if that would be the same list or not) or is the intention that I
bind this to the list that is appropriate for me in which case maybe it
should start out as an empty list.
I think we should provide a proper list of default values for xhtml
(or whatever the most common standard people use).

If you can research and come up with an updated list of tags I think
Edi will be happy to take it in.

Regards,
-- Mac
Edi Weitz
2007-05-28 18:33:49 UTC
Permalink
Post by Simon Cusack
I changed
(member tag *html-empty-tags*)
to
(member tag *html-empty-tags* :test #'string-equal)
Thanks, your fix is in the new release.

Loading...