Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-10-17 13:22:51

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,633

Re: Auto trim list items

Tangentially related: I have to say I’m really appreciating the numerous small changes to tags, internals and other nerdy stuff recently. Thank you Stef, Oleg and other contributors!

Offline

#12 2019-10-18 06:54:44

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

Re: Auto trim list items

etc wrote #319756:

It’s a one-liner anyway, so let’s test.

Based on a brief look at the code, and an equally short round of testing, it is an opt-in feature, correct?

FWIW, I think it is the correct thing todo. If you really want that space before the separator, add it manually (and in most cases, a non-breaking space is probably more appropriate).

—-
Also +100 for gaekwad’s comment.

Online

#13 2019-10-18 07:43:23

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

Re: Auto trim list items

phiw13 wrote #319759:

it is an opt-in feature, correct?

FWIW, I think it is the correct thing todo. If you really want that space before the separator, add it manually (and in most cases, a non-breaking space is probably more appropriate).

Currently it is opt-in (via trim), the question is: should be semi-automatic? Say, if break starts or ends with a space (like in break=", "), should we trim the list items, unless told otherwise?

And thanks you both, appreciated!

Offline

#14 2019-10-18 08:37:44

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

Re: Auto trim list items

etc wrote #319760:

Currently it is opt-in (via trim), the question is: should be semi-automatic? Say, if break starts or ends with a space (like in break=", "), should we trim the list items, unless told otherwise?

And thanks you both, appreciated!

I don’t think you should trim the space in break=", ", after all it looks like the user has specified it thus. If, on the other hand, TXP or PHP generates extra spaces, yeah, those could go.

(and it is grammatically correct in most languages to have that space there)

Online

#15 2019-10-18 09:23:52

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

Re: Auto trim list items

phiw13 wrote #319761:

I don’t think you should trim the space in break=", ", after all it looks like the user has specified it thus. If, on the other hand, TXP or PHP generates extra spaces, yeah, those could go.

No, we won’t trim the space in break, and txp/php does not generate extra spaces. That’s the users themselves that introduce them by prettifying the code:

<txp:category_list>
    <txp:category />
</txp:category_list>

is actually

newline+4spaces+<txp:category />+newline

And the space surrounding <txp:category /> is not always desirable in the final output.

Offline

Board footer

Powered by FluxBB