By Christopher Ambler on Friday, 21 August 2020
Posted in Technical Issues
Replies 3
Likes 0
Views 683
Votes 0
The tag stripping made Twitter posts look terrible, so I changed the code. I'd love to see you guys do this in the next release so I don't have to keep replacing the code

In short - change paragraph and break tags to newlines BEFORE stripping tags. This makes formatting correct.


// Replace the {introtext} tag

if (EBString::stristr($content, '{introtext}') !== false) {

$search[] = '{introtext}';

// Don't strip tags, so we can put newlines in for <p> and <br> elements first
$introText = $post->getIntro();

$introText = str_ireplace("<p>", "\n\n", $introText);
$introText = str_ireplace("<br>", "\n", $introText);
$introText = str_ireplace("<br/>", "\n", $introText);
$introText = str_ireplace("<br />", "\n", $introText);

// Now we can strip the tags, which will clean up the text

$introText = EBString::substr(strip_tags($introText), 0, 230) . JText::_('COM_EASYBLOG_ELLIPSES');

$replace[] = $introText;
}
PS: Please do the same for Facebook and LinkedIn, if you would be so kind.
·
Friday, 21 August 2020 08:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your input, we will consider to add this in the future.
·
Friday, 21 August 2020 15:15
·
0 Likes
·
0 Votes
·
0 Comments
·
·
Monday, 24 August 2020 22:17
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post