You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trim regex given as an example to trim body for excerpt seems to trip up if textile is enable in the body field (prepending the truncated text with p>), no matter what the escape attributes. I have better luck with <txp:body escape="tags" trim="/^(<[^>]*>)*((?:\w+\W+){35})\w.*$/s" replace="$2…" />, which excludes initial tags.
Hi,
I've just reinstated the trim regex from the TXP docs and made a test article using a couple of paragraphs of plain text. Screenshots attached of front and back end, firstly with Textile on then with it off.
I've only seen this happen on a couple of older sites, so may be something in the config or hosting conditions or a plugin.
I've tried the regex on the regex101 site and it removes the opening bracket from an opening p tag, so I'm guessing the regex trim happens before the transform / escape?
Thank you. Have you also set escape="tags" attribute before trim? Unless php strip_tags() function is somehow disabled on your server (see diagnostics), it should have removed all html tags prior to trimming.
This said, the example regex might be a bit loose, indeed.
Activity
bloatware commentedon Jan 29, 2024
Thank you for the report, but I'm not sure textile interferes here. Could you provide more details re the article body content?
butterp1 commentedon Jan 30, 2024
Hi,
I've just reinstated the trim regex from the TXP docs and made a test article using a couple of paragraphs of plain text. Screenshots attached of front and back end, firstly with Textile on then with it off.
I've only seen this happen on a couple of older sites, so may be something in the config or hosting conditions or a plugin.
I've tried the regex on the regex101 site and it removes the opening bracket from an opening p tag, so I'm guessing the regex trim happens before the transform / escape?
LEAVE TEXT UNTOUCHED

TEXTILE

bloatware commentedon Jan 31, 2024
Thank you. Have you also set
escape="tags"attribute beforetrim? Unless phpstrip_tags()function is somehow disabled on your server (see diagnostics), it should have removed all html tags prior to trimming.This said, the example regex might be a bit loose, indeed.