phpti icon indicating copy to clipboard operation
phpti copied to clipboard

somehow trim whitespace when blocks are placed in attributes

Open arshaw opened this issue 14 years ago • 2 comments

<meta name='description' content='<? emptyblock('metadescription') ?>' />

....

<? startblock('metadescription') ?>
my value
<? endblock() ?>

.... don't want this ....

<meta name='description' content='
my value
' />

PHPTI NEEDS TO BE SMARTER ABOUT THIS

arshaw avatar May 18 '10 19:05 arshaw

According to http://phpti.com/#block-filters , you can write

<? startblock('metadescription', 'trim') ?>
my value
<? endblock() ?>

SimonSapin avatar Jul 21 '10 14:07 SimonSapin

yeah, good point. but it'd be cool to transparently do this somehow, without the need to reference the trim filter. maybe that would be too hairy though, and this is the ideal solution

arshaw avatar Jul 22 '10 02:07 arshaw