backdrop-contrib / mastotoot

Automatically share your Backdrop CMS posts on a Mastodon instance.
https://backdropcms.org/project/mastotoot
GNU General Public License v2.0
1 stars 0 forks source link

Decode entities after text_summary creation #2

Closed indigoxela closed 9 months ago

indigoxela commented 9 months ago

text_summary() causes newlines and white space to get encoded to, for example 
.

That's not what we want. Newlines should get passed as-is.

Example code to reproduce:

$node = node_load(200);
$text_fields = field_get_items('node', $node, 'body');
$text_field = reset($text_fields);
$stripped = strip_tags($text_field['value']);
$text = text_summary($stripped, NULL, 400);

debug($text);