whoops, forget what I said. Apparently any attribute without a specific 
value is syntactically equivalent to "".
So, @Kirill, there's no way but ending up with _pubdate='' will give you a 
syntactically equivalent markup.

Unless I'm reading w3c spec wrong, in that case feel free to correct me.

On Monday, August 29, 2016 at 11:37:53 PM UTC+2, Niphlod wrote:
>
> ATM "False" or "None" don't have the corresponding attribute inserted. 
> There's no way to generate an attribute without value.
>
> BTW: that is definitely not a good example as it's not HTML5 valid syntax. 
> A better one could have been 
>
> <article itemscope itemtype="http://n.example.org/rfc4287";>
>    <h1>hi</h1>
> </article>
>
>
> @mdipierro: any thoughts about this ? If I'm not mistaken, the offending 
> line is from #L936 
> <https://github.com/web2py/web2py/blob/master/gluon/html.py#L936> to #L947 
> <https://github.com/web2py/web2py/blob/master/gluon/html.py#L947> ... 
> maybe _pubdate=None should result in an empty attribute ?
> BTW2: the referenced page <http://www.web2py.com/init/default/examples>with 
> the new style is a pain to read.
>
> On Monday, August 29, 2016 at 9:44:59 PM UTC+2, Kirill Shatalaev wrote:
>>
>>
>> So, how to do some like:
>>
>> <time pubdate datetime="2009-10-09">1 day ago</time>
>>
>>
>> I tried:
>>
>>
>> TAG.time('1 day ago', _pubdate=True,
>>  _datetime=str(datetime.year) + '-' + '%02d' % datetime.month + '-' + '%02d' 
>> % datetime.day)
>>
>>
>> And got:
>>
>>
>> <time datetime="2009-10-09" pubdate="pubdate">1 day ago</time>
>>
>>
>> Here I can read:
>>
>> http://www.web2py.com/init/default/examples
>>
>>
>> "attributes without value like "READONLY" can be created with the argument 
>> "_readonly=ON"."
>>
>>
>> But not _pubdate=True, nor _pubdate=ON (wich is deprecated and just an alias 
>> for True according to chapter 5) does not work for me and generates 
>> pubdate="pubdate".
>>
>>
>>
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to