You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Mike D Pilsbury <mi...@pekim.co.uk> on 2007/02/28 21:48:40 UTC
Encoding entitie in DefaultMarkupModel
I hit a problem whereby I couldn't work out how to generate a
soft-hyphen (­) in a grid cell. The text was coming from the grid's
model.
If the text contained '­', the ampersand was being replaced with
'&' by DefaultMarkupModel, resulting in '&shy;'. It would be
nice if the text could simply contain the appropriate Unicode character
(in this case '\u200b') and the MarkupModel encoded it as required (as
currently happens for '<', '>' and '&').
A quick experiment with hacking DefaultMarkupModel produced the desired
result ('\u200b' encoded to '​').
public void encode(String content, StringBuilder buffer)
{
buffer.append(org.apache.commons.lang.StringEscapeUtils.escapeHtml(content));
}
Would a change along those lines have any downside? Perhaps more
importantly, have I missed an existing means of working around the problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org