Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Empty 'break' attr causing a comma to act as a list item separator?
Adding an empty string as break
attribute to any(?) txp tag apparently causes a comma to be set as the implicit list item separator character. This is a new behaviour to me, which broke a site in the course of a recent Textpattern version upgrade to 4.8.8, methinks.
I believe this behaviour was not present in older versions. Omitting the break
attribute results in a different output.
Let me explain with an example.
<txp:evaluate>foo, bar</txp:evaluate>
gives the expected output foo, bar
.
<txp:evaluate break="">foo, bar</txp:evaluate>
results in the rather unexpected output foobar
. The comma is eaten alive.
I wonder if this is the intended behaviour and if I could find it somewhere in the Textbook to improve my txp:knowledge.
Offline
Re: Empty 'break' attr causing a comma to act as a list item separator?
Hi Robert,
My intentions were good, but nothing is bug-free. Could you tell me what tag was broken by this break
behaviour? I guess it was not <txp:evaluate />
, since it does (did) not accept break
attribute.
Offline
Re: Empty 'break' attr causing a comma to act as a list item separator?
Offline
Re: Empty 'break' attr causing a comma to act as a list item separator?
I see. But what was the purpose of break
attribute in <txp:excerpt />
? At this time break
wasn’t (?) global, and <txp:excerpt />
never had its own attributes (they were silently ignored). Just remove break
and everything should be fine.
The idea behind recent break
bug/feature is to turn it into a poor man’s list tag (we still have none in txp). Typically, one wouldn’t use break
with no purpose in non-listing tags. For example, what <txp:site_slogan break="br" />
is expected to output? Now it has a meaning.
Suppose that the site slogan is veni, vidi, vici
. Then the output of <txp:site_slogan break="br" />
will be
veni<br>
vidi<br>
vici
By default, strings are broken by comma, but this can be set via breakby
attribute: <txp:site_slogan breakby="v" break="br" />
outputs
<br>
eni, <br>
idi, <br>
ici
Offline
Re: Empty 'break' attr causing a comma to act as a list item separator?
Just remove break and everything should be fine.
You are simply right.
I cannot remember when, but once when I built this site I think <txp:excerpt />
split its $thing
on commas and I got rid of this unwanted behaviour by issuing an empty-string break
attibute.
However, issue resolved in the most appealing way: Just doing nothing.
Offline
Re: Empty 'break' attr causing a comma to act as a list item separator?
Since this has bitten yet another site, the implicit breaking is removed. One has to explicitly set breakby
attribute now.
No extra work for Robert required.
Offline