Discussion:
html empty tags
Mac Chan
2007-04-27 05:19:36 UTC
Permalink
As you probably know, there are certain html tags that will break the
browser's rendering if they are not paired up properly with a close
tag </tag> even if it's content is empty.

For example, <textarea> and <script> (ie)

Well today I'm bitten by this, where <div id='header' /> messes up
firefox's rendering coupled with some css rules.

Even though I'm awared of how to get around it, sometimes it's rather
hard to spot that with a sea of nested (:div (:div ...)).

This is also a recurring problem for newbie and there were a few
threads regarding this.

Attach is a patch to fix this.

[Special variable]
*html-empty-tag-aware*

Set to NIL to if you want to use cl-who as a strict XML generator.
Otherwise, CL-WHO will only close empty tag defined in
*html-empty-tags* with <tag/> (XHTML mode) or <tag> (SGML mode). For
all other tags, it will always generate <tag></tag>. The default is T.

[Special variable]
*html-empty-tags*

List of html tags that should close by itself. The default values
are '(:base :basefont :br :frame :hr :img :input :isindex :link :meta
:nextid :range :spacer :wbr :audioscope :area :param :keygen :col
:limittext :spot :tab :over :right :left :choose :atop :of)


I'm not sure if anyone is using cl-who to generate XML. If it is, then
you need to set *html-empty-tag-aware* to NIL, because this patch will
change the default behavior (to do the right thing).

Regards,
-- Mac
Edi Weitz
2007-04-27 09:42:46 UTC
Permalink
Post by Mac Chan
As you probably know, there are certain html tags that will break
the browser's rendering if they are not paired up properly with a
close tag </tag> even if it's content is empty.
For example, <textarea> and <script> (ie)
Well today I'm bitten by this, where <div id='header' /> messes up
firefox's rendering coupled with some css rules.
Even though I'm awared of how to get around it, sometimes it's
rather hard to spot that with a sea of nested (:div (:div ...)).
This is also a recurring problem for newbie and there were a few
threads regarding this.
Attach is a patch to fix this.
Thanks, that's quite useful. I've incorporated it into the new
release.

However, I think the actual test you had in who.lisp is not quite what
you meant. Please check if my modification is OK. You also forgot to
export the new symbols... :)
Post by Mac Chan
I'm not sure if anyone is using cl-who to generate XML.
I'm pretty sure some people do. I also did it a couple of times.

Thanks,
Edi.
Cyrus Harmon
2007-04-27 15:10:58 UTC
Permalink
It's a rather simple XML usage, but I'm using cl-who for generating
the RSS for nuclblog.

It was a bit of a challenge figuring out how to get tag downcasing
for all the HTML stuff, and preserving for the XML stuff, but it
works now.

Cyrus
Post by Edi Weitz
Post by Mac Chan
As you probably know, there are certain html tags that will break
the browser's rendering if they are not paired up properly with a
close tag </tag> even if it's content is empty.
For example, <textarea> and <script> (ie)
Well today I'm bitten by this, where <div id='header' /> messes up
firefox's rendering coupled with some css rules.
Even though I'm awared of how to get around it, sometimes it's
rather hard to spot that with a sea of nested (:div (:div ...)).
This is also a recurring problem for newbie and there were a few
threads regarding this.
Attach is a patch to fix this.
Thanks, that's quite useful. I've incorporated it into the new
release.
However, I think the actual test you had in who.lisp is not quite what
you meant. Please check if my modification is OK. You also forgot to
export the new symbols... :)
Post by Mac Chan
I'm not sure if anyone is using cl-who to generate XML.
I'm pretty sure some people do. I also did it a couple of times.
Thanks,
Edi.
_______________________________________________
cl-who-devel site list
http://common-lisp.net/mailman/listinfo/cl-who-devel
Mac Chan
2007-04-27 18:56:33 UTC
Permalink
Post by Edi Weitz
However, I think the actual test you had in who.lisp is not quite what
you meant. Please check if my modification is OK. You also forgot to
export the new symbols... :)
Argh... my bad.

BTW, I immediately found a bug! ........ in the doc ;-)

since you introduced a new file, this probably isn't true anymore

cat {packages,who}.x86f > cl-who.x86f

Cheers,
-- Mac
Edi Weitz
2007-04-27 19:12:01 UTC
Permalink
Post by Mac Chan
BTW, I immediately found a bug! ........ in the doc ;-)
Argh - I had complete forgotten about all this old cruft. I've
cleaned it up now.

Thanks,
Edi.

Loading...