Do you need this function or could the underscore escape function work? http://underscorejs.org/#escape