Subject: | Don't expand in "foo bar" |
The _decode_entities() function has an $allow_unterminated parameter
that is documented as this:
If $allow_unterminated is TRUE then we also unterminated
named entities will also be expanded. The longest
matching name in %entity2char will be used.
$string = "foo bar";
_decode_entities($string, { nb => "@", nbsp => "\xA0" },
1);
print $string; # will print "foo bar"
other browsers will not expand an unterminated entity name that is
followed by another letter or digit. HTML::Entities should do the
same.