Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How do I create non-breaking space (  ) with HTML::Element?

by Marel (Initiate)
on Mar 15, 2012 at 22:22 UTC ( [id://959875]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://959875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found