in server/src/main/scala/com/twitter/server/util/HtmlUtils.scala [8:23]
def escapeHtml(s: String): String = {
val out = new StringBuilder(s.length)
var pos = 0
while (pos < s.length) {
s.charAt(pos) match {
case '<' => out.append("<")
case '>' => out.append(">")
case '&' => out.append("&")
case '"' => out.append(""")
case '\'' => out.append("'")
case c => out.append(c)
}
pos += 1
}
out.toString
}