Re: Several doubtful points on the manual

Albert Kam <[email protected]> Tue, 12 Mar 2013 12:55:48 +0700
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAMT20g8=eb4xi8h0Dx5QdZ4d6cjE1is=6rmSiBHVsZkbaJwVLw@mail.gmail.com>
Oh, i got what you mean now.

I was stuck with how to enable html escaping for every templates,
and ended up using the solution from here (although i skip the
strip_whitespace part and add it in the configuration setting instead) :
http://watchitlater.com/blog/2011/10/default-html-escape-using-freemarker/

Thank you for your time Daniel !

Regards from Jakarta,
Albert Kam


On Tue, Mar 12, 2013 at 3:21 AM, Daniel Dekany <[email protected]> wrote:

> Monday, March 11, 2013, 6:03:25 AM, Albert Kam wrote:
>
> > Thanks for the thread explaining the best practices for the macro,
> function and interpolation.
> > So basically the conclusion that i got is that there is nothing
> > that is --automatically-- escaped with the current stable version.
>
> I guess putting the whole template inside #escape counts as automatic
> escaping of ${...}-s. Well, it's not entirely automatic... but I used
> to put templates into it.
>
> > I guess its the 'automatic' part in the manual that i pasted earlier
> that got me doubtful.
> >
> > Regards from Jakarta,
> > Albert Kam
> >
> >
> > On Sun, Mar 10, 2013 at 7:18 PM, Daniel Dekany <[email protected]>
> wrote:
> > Sunday, March 10, 2013, 1:15:13 PM, Daniel Dekany wrote:
> >
> >> Saturday, March 9, 2013, 4:55:07 PM, Albert Kam wrote:
> >>
> >>> Hello, thank you for the response ..
> >>>
> >>>> It is subject to escaping *if* you use #escape.
> >>> Did you mean the function's result ? That's why i was doubtful,
> >>> because it says in the manual 'subject to --automatic-- xml escaping.
> >>
> >> The only thing that might applies auto-escaping is `${...}`, but to
> >> insert the values of functions till 2.3.30
> >
> > I meant 2.3.20. Here's the relevant quote from earlier mailing, which
> > also clarifies what's the difference between #functions and
> > #macros/directives:
> >
> >   http://thread.gmane.org/gmane.comp.web.freemarker.devel/7950
> >
> >> you can only use `${...}`.
> >>
> >>>> Not so for macro calls.
> >>> Did you mean macro calls will result in escaped content automatically ?
> >>
> >> It's assumed to be *already* escaped on the caller side.
> >>
> >>>> Exactly, this allows you to add newlines in the template without
> breaking the layout. Hence it improves readability.
> >>> Ah, makes sense ! But in the context of 'library' template with
> >>> only macros only, i imagine we can add newlines also without
> >>> strip_text, and not breaking anything, because the what is important
> >>> is the macros, not the newlines or any other texts outside the macros,
> am i correct ?
> >>
> >> Correct, except that the legacy way of pulling in a library is with
> >> #include, which can print to the output of the template that uses it.
> >>
> >
> > --
> > Best regards,
> >  Daniel Dekany
> >
> >
> >
> ------------------------------------------------------------------------------
> > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> > endpoint security space. For insight on selecting the right partner to
> > tackle endpoint security challenges, access the full report.
> > http://p.sf.net/sfu/symantec-dev2dev
> > _______________________________________________
> > FreeMarker-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/freemarker-user
> >
> >
> >
>
> --
> Best regards,
>  Daniel Dekany
>
>
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>



-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user