myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heath Borders <heath.bord...@gmail.com>
Subject Re: HTMLEcoder and \n
Date Tue, 29 Mar 2005 14:52:17 GMT
For something like <h:outputText /> its really not hard to write your
own renderer, or to write a custom renderer.  We could always apply
logic like you're asking to an <x:outputText /> tag/renderer.


On Tue, 29 Mar 2005 08:59:27 +0200, Mathias Broekelmann
<mbroekelmann@psi.de> wrote:
> Hi,
> 
> wouldn´t it be nice to have a pluggable interface for those issues?
> Setting escape to false requires the user to encode all characters to
> valid html/xml. We also have a requirement to print <sup> or <sub>
> markups which replaces special chars in the strings. That interface
> could be retrieved and registered through an Application sub class.
> 
> Mathias
> 
> Oliver Rossmueller wrote:
> > Sylvain Vieujot wrote:
> >
> >> By default, HTMLEncoder.encode( txt ) doesn't encode \n to <br/>.
> >> So, <h:outputText> doesn't encode the new lines either.
> >>
> >> Is this expected ?
> >>
> >> My guess would be that by default, the new lines should be encoded.
> >
> >
> > Sylvain,
> >
> > to not encode newline characters is expected behaviour, the spec does
> > not require h:outputText to encode newlines. There is only the
> > requirement that
> >
> >    "characters that are sensitive in HTML and XML markup must be escaped"
> >
> > when the encode flag is set to true (which is the default). So if you
> > need <br /> for newlines in your text you have to do it on your own (and
> > don't forget to set encode="false" for the h:outputText in this case
> > otherwise the <br/>s will end up on the user's screen).
> >
> > Oliver
> >
> >>
> >> Sylvain.
> >
> >
> >
> >
> 
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org

Mime
View raw message