intercom/banjaxed — pull request #33 by eugeneius (2014-11-10 16:30:12+00:00)
Title: Render comments in Ruby instead of JavaScript

Instead of fetching new comments as JSON and rendering them in JavaScript, we now return fully rendered HTML. This will let us do fancier stuff with comment bodies - autolinking, markdown, emoji, etc.

This approach utilises the SJR technique as described here: https://signalvnoise.com/posts/3697-server-generated-javascript-responses

SJR is somewhat controversial, but I think it's appropriate here. Writing JavaScript by hand to transform JSON into HTML, as we were doing before, is much more likely to cause security issues than using SJR.