Merge pull request #360 from rgarmsen2295/mm-375d

MM-375 Adds text formatting features using a modified version of the marked js library
Этот коммит содержится в:
Joram Wilander
2015-08-14 09:28:24 -04:00
родитель 92c4df5b10 41e74860d8
Коммит b9aef9f2a6
19 изменённых файлов: 2072 добавлений и 126 удалений

Просмотреть файл

@@ -11,6 +11,7 @@ var BrowserStore = require('../stores/browser_store.jsx');
var utils = require('../utils/utils.jsx');
var SidebarHeader = require('./sidebar_header.jsx');
var SearchBox = require('./search_bar.jsx');
var formatText = require('../../static/js/marked/lib/marked.js');
var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
@@ -209,6 +210,11 @@ module.exports = React.createClass({
utils.notifyMe(title, username + ' did something new', channel);
}
} else {
var allowTextFormatting = config.AllowTextFormatting;
if (allowTextFormatting) {
notifyText = formatText(notifyText, {sanitize: false, mangle: false, gfm: true, breaks: true, tables: false, smartypants: true, renderer: utils.customMarkedRenderer({disable: true})});
}
notifyText = utils.replaceHtmlEntities(notifyText);
utils.notifyMe(title, username + ' wrote: ' + notifyText, channel);
}
if (!user.notify_props || user.notify_props.desktop_sound === 'true') {