Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Created March 20, 2011 00:50
Show Gist options
  • Select an option

  • Save dustingetz/877957 to your computer and use it in GitHub Desktop.

Select an option

Save dustingetz/877957 to your computer and use it in GitHub Desktop.
stateful html generator evil!
public WriterBackedGenerator write(String text)
{
text = ((text == null) ? "" : text);
if (_scripting || _noEscape) // *djg* horrors!!
{
writeToBuffer(text);
}
else if (text.equals(" "))
{
writeToBuffer(" ");
}
else
{
writeToBuffer(StringUtils.escapeForXMLAttribute(text));
}
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment