Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 Yesterday 13:23:52

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

Re: Removing blank lines for txp tags that don't output anything

Bloke wrote #339435:

My gut feeling says yes, simply for improved readability, but I’m not sure if it might have ramifications in edge cases.

That’s the problem, sometimes you want the tag output to be trimmed, as in

<if::custom_field name="serial">
   (<custom::field name="serial" />)
</if::custom_field>

but sometimes not:

<figure<if::yield name="class"> class="<txp:yield name='class' />"</if::yield>>

Same for the ‘outer’ line-breaks, I guess. We could do something smart, like avoiding blank lines, but it would be less predictable.

Offline

#14 Yesterday 15:22:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,683
Website GitHub

Re: Removing blank lines for txp tags that don't output anything

Ack, leave it. There are plenty of ways to trim content. I’m not losing sleep over it.


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