Reputation: 2126
I've two questions:
If I take out any text using text() or as_trimmed_text() function and want to push in some element then do I need to use HTML::Entities::encode_entities? :
my $text=$node->as_trimmed_text();
$a->push_content($text); # Do I need to use encode_entities here?
Â
) as an extra char when all I see is single space in Dreamweaver.Upvotes: 0
Views: 348
Reputation: 94834
I have two answers:
$a
to be the same as the content of $node
, you do not need to encode_entities
as push_content
inserts the passed string as a text node rather than parsing it as markup. OTOH, if the content of $node
is <span>
(represented in HTML source as <span>
) and you actually want $a
to display <span>
(represented in HTML source as &lt;span&gt;
), you would call encode_entities
on it.Upvotes: 2