Add non-keyword/bare/string attributes to tags without Doc.asis
AndydeCleyre opened this issue · 3 comments
AndydeCleyre commented
Hi,
Thanks for working on yattag! Is it currently possible to add non-keyword attributes to tags?
Something like:
with tag('paper-button', 'raised'):
text('I am a fancy button')
and have it render to:
<paper-button raised>
I am a fancy button
</paper-button>
The best I can figure out right now is just dropping the whole html block into a Doc.asis
call.
leforestier commented
Hi Andy,
what about writing:
<paper-button raised="raised">
I am a fancy button
</paper-button>
since they are equivalent ?
leforestier commented
I actually added the feature. Exactly as you suggested, you can now write:
with tag('paper-button', 'raised'):
text('I am a fancy button')
and get:
<paper-button raised>
I am a fancy button
</paper-button>
AndydeCleyre commented
Thanks, that's great!