Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-10-30 07:13:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,592
Website

Re: [solved] pre (in relation to escape="" attribute in txp:body)

Bloke wrote #319869:

Generally, yes. Using trim especially is perhaps ill-advised … or does it act on every block-level tag in txp:body?

P. Why trim? I thought that only acted on the outer limits of a string… Or does it act on every block-level HTML tag within the body?

I would have thought that tidy and especially tags have a more dramatic effect. Have I misunderstood that all this time?


TXP Builders – finely-crafted code, design and txp

Offline

#12 2019-10-30 07:57:06

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,759
Website

Re: [solved] pre (in relation to escape="" attribute in txp:body)

Bloke wrote #319869:

Generally, yes. Using trim especially is perhaps ill-advised, but if you wanted to, for example, strip out any unwanted tags that an author may have used inline, escape could be mighty handy as a filter.

There are certainly use cases (you mention a good one!) for applying the escape attribute to such a high level, all encompassing container tag as @<txp:body />. But it requires serious thought to use.

Offline

#13 2019-10-30 15:29:10

etc
Developer
Registered: 2010-11-11
Posts: 3,427
Website

Re: [solved] pre (in relation to escape="" attribute in txp:body)

phiw13 wrote #319871:

There are certainly use cases (you mention a good one!) for applying the escape attribute to such a high level, all encompassing container tag as @<txp:body />. But it requires serious thought to use.

IIRC, Phil uses <txp:excerpt escape="json" /> for exporting articles as JSON-LD. Anyway, nobody is supposed to employ all txp attributes at once – the less the better.

Offline

#14 2019-10-30 17:36:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,841
Website

Re: [solved] pre (in relation to escape="" attribute in txp:body)

jakob wrote #319870:

Why trim?

Ack, I meant tidy, you’re right. Sorry. Slip of the mind/keyboard.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB