Closed rajeshnair closed 2 years ago
You can use (key, value) pairs. Like this:
with tag('label', ('for', 'r1')):
...
Thanks ! That works!
But I did not see that documented anywhere.
Also should not the same scenario be used to handle the class
keyword.
Having two different mechanism for handling python keywords is confusing for users
The use of (key, value) pairs to pass html attributes is mentionned on https://www.yattag.org
As for the class
/klass
trick, if I had to write that library from scratch, I wouldn't include it. But I can't remove it since a lot of people rely on it now.
I need to generate html
label
keyword which usesfor
as attributeBut this cannot be done using yattag as for is also a python keyword. Can simply be handled as
class
keyword is handledgives