Skip to content

Instantly share code, notes, and snippets.

@jmramos02
Last active May 20, 2016 07:21
Show Gist options
  • Save jmramos02/11f63f28ce5c47128dd1363c787dbe8e to your computer and use it in GitHub Desktop.
Save jmramos02/11f63f28ce5c47128dd1363c787dbe8e to your computer and use it in GitHub Desktop.
_cleanupLineBreaks: function(toBeCleaned) {
var cleaned = toBeCleaned;
_.each(cleaned, function(value, key) {
var value = _.escape(value).replace(/\n/g, '<br>');
cleaned[key] = value.replace('<br><br><br><br><br>','<br>'); //replace excess line breaks on address
});
return cleaned;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment