On May 17, 2012, at 7:51 AM, Massimo Di Pierro wrote:
> It should be
>
> head.append(TH(header, _class=ui.get('default')))
>
> when an attribute is None, it is not displayed.
That makes sense.
>
> On Thursday, 17 May 2012 09:28:33 UTC-5, Jonathan Lundell wrote:
> I noticed, using SQLFORM.grid, that I get occasional empty class attributes,
> something like <th class>foo</th>. I assume that this is a consequence of
> calls like this one:
>
> head.append(TH(header, _class=ui.get('default','')))
>
> It'd be nice, though probably not critical, to fix that, but it's a subtle
> problem. Stripping all attributes with empty values is likely to cause
> behavioral changes, since there are attributes (I forget which ones at the
> moment) that have effect without having values. It does seem worth a little
> effort, though, to clean up what we can.
>
> Maybe XML() (or wherever) could have a frozenset of attribute names that
> should be suppressed if they come without values?