gsd4me has asked for the wisdom of the Perl Monks concerning the following question:
Am trying to generate some HTML using HTML::Tiny, which has been a good resource, up until now! I want to create an HTML5 tag of audio, such as:
using the perl code:<audio controls> src = "file.mp3", type = "audio/mpeg" </audio>
which produces this output:$co->tag ('audio', { controls=>[], type => "audio\/mpeg", src => "$fil +ename.".mp3"})
In the HTML::Tiny documentation, it states (from the CPAN depository)<audio controls="controls" src="theme1.mp3" type="audio/mpeg"></audio>
so what I want is an empty attribute for my "controls" part of the audio tag, which is obviously what is not happening. Any guidance? regards ADBAn empty attribute - such as 'checked' in a checkbox can be encoded by + passing an empty array reference: print $h->closed( 'input', { type => 'checkbox', checked => [] } ); would print <input checked type="checkbox" />
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Tiny, null parameter tags contradicting documentation
by tobyink (Canon) on Aug 24, 2018 at 11:21 UTC | |
|
Re: HTML::Tiny, null parameter tags contradicting documentation
by TheloniusMonk (Sexton) on Aug 24, 2018 at 07:41 UTC | |
|
Re: HTML::Tiny, null parameter tags contradicting documentation
by Lotus1 (Vicar) on Sep 02, 2018 at 18:08 UTC |