Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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: 3,079
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)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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