Path: blob/master/emojionearea/src/function/htmlFromText.js
575 views
define([1'var/emojione',2'function/unicodeTo'3],4function(emojione, unicodeTo) {5return function(str, self) {6str = str7.replace(/&/g, '&')8.replace(/</g, '<')9.replace(/>/g, '>')10.replace(/"/g, '"')11.replace(/'/g, ''')12.replace(/`/g, '`')13.replace(/(?:\r\n|\r|\n)/g, '\n')14.replace(/(\n+)/g, '<div>$1</div>')15.replace(/\n/g, '<br/>')16.replace(/<br\/><\/div>/g, '</div>');17if (self.shortnames) {18str = emojione.shortnameToUnicode(str);19}20return unicodeTo(str, self.emojiTemplate)21.replace(/\t/g, ' ')22.replace(/ /g, ' ');23}24});2526