in reply to How do I create non-breaking space (  ) with HTML::Element?

Old question, new answer:
use strict; use warnings; use HTML::Element; use Test::More qw(no_plan); my $nbsp = chr(160); my $element = HTML::Element->new_from_lol( ['td', {"class"=>"zwischanspalte"}, $nbsp] ); my $expected = '<td class="zwischanspalte">&nbsp;</td>'; my $html = $element->as_HTML(); is($html, $expected);
For me chr(160) is handier then using ~literal etc. as it can easily combined in strings.
  • Comment on Re: How do I create non-breaking space (&nbsp; ) with HTML::Element?
  • Download Code