Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
Re: exclude article
for your interest, I noticed the attribute escape="tags"
produces (from the regex) an invalid character if the final sign is accentuated (e.g. î ).
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: exclude article
Pat64 wrote #336407:
I noticed the attribute
escape="tags"
produces (from the regex) an invalid character if the final sign is accentuated (e.g. î ).
Sorry, Patrick, not sure to understand: escape="tags"
calls php strip_tags()
function, there is no regex involved. Mind providing more details?
Offline
Re: exclude article
Well.
A few days ago, working on a new project, I encounter a strange behavior.
Based on this sentence: “Dans un véritable récit de voyage, le scientifique retrace son parcours de chercheur et nous entraîne dans une étonnante enquête archéologique.” and your code:
<txp:hide process="1" trim="/^\s*(.{95}\w*)\b.+$/s" replace='$1… <a href="<txp:permlink />">Lire la suite</a>'>
<txp:body />
</txp:hide>
The result produced this:
Dans un véritable récit de voyage, le scientifique retrace son parcours de chercheur et nous entra… Lire la suite
The final î character is changed by a not well encoding sign (can’t include it here because Textile rejects the sign: a question mark).
Note: I’m using TXP 4.9-dev for devs demand testing by users on a local server (MAMP for PCs, PHP version: 8.0.1, MySQL: 5.7.24). Sometimes when I change the length of the REGEX (words count below {104}), the entire page crashes (nothing is rendering)…
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: exclude article
Ah, ok, this pattern. It’s not a bug, you need to add u
modifier to regex for Unicode:
<txp:hide process="1" trim="/^\s*(.{95}\w*)\b.+$/us" replace='$1… <a href="<txp:permlink />">Lire la suite</a>'>
<txp:body />
</txp:hide>
Offline
Re: exclude article
Perfect, Oleg. You are a programming master!
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Offline