On 2/6/2013 4:02 AM, Lance Java wrote:
> I'd just write my own component, SpecialOutput, which splits the input on
> CRLF and uses MarkupWriter.write(...) for text you want escaped and
> MarkupWriter.writeRaw(...) for text you don't want escaped.
>
> IMHO I think that using paragraph tags (<p>...</p>) is more semantic than
> <br />
>
Thanks.

I also got several suggestions to use outputraw.  That doesn't solve my
problem, because I only want a small portion of my string to be output
raw, the part that has embedded HTML tags in it.  The rest, which is
coming from the database, I want properly escaped.

I had hoped that I could just call the code Tapestry uses to escape
strings, and build my string up myself in my page class.

I hadn't thought to do it with a component.  So I'm looking into that. 
Candidly, this is my first time trying to use MarkupWriter in a
component, as opposed to a template.

I think what I want to do is disable the default render of the
component's body (which will contain the text to be specially output),
and instead put my marked-up text into the MarkupWriter myself.  Right? 
So I think I want to write a @BeforeRenderBody method, send my text to
the MarkupWriter in that method, and return false from it, so that the
default body render doesn't happen.

However, I can't figure out how to actually _get_ the contents of the
tag's body inside of my @BeforeRenderBody method.  Does it have
something to do with zones?

Thanks,

Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to