rejetto forum

Macros and white space

0 Members and 1 Guest are viewing this topic.

Offline Unknown8063

  • Occasional poster
  • *
    • Posts: 96
    • View Profile
I'm finally getting around to playing with template macros and noticed that white space tends to grow very rapidly around complex if structures.  That is white space that appears when I view source in my browser that is left behind from my macro indenting.

Because HFS interprets all macros before anything is sent to the browser this isn't an issue, I suppose.  I'm used to PHP and I was worried the excess white space would prevent my add header macro - but that wasn't the case.  HFS executes everything before it releases the buffer so you can actually use {.add header.} in the footer if you want to.

However, is there a way to contain macro scripts so they don't output anything to the browser?

EDIT: Oh! I just realized the {.comment.} macro can be used for this
« Last Edit: January 16, 2009, 05:16:49 AM by Unknown8063 »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
great :D
i would have said {.trim.}
it reduces only spaces
{.comment.} will reduce anything


jorge

  • Guest
Hi. i am try to find other users so that i can connect to please. the idea looks great.
looking forward to make it work and find other users.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile