2016-11-14 20:27:23 +01:00
|
|
|
import marked from 'marked';
|
2016-11-14 17:17:44 +09:00
|
|
|
import Posts from "meteor/nova:posts";
|
|
|
|
import Users from 'meteor/nova:users';
|
2016-12-13 11:40:24 +09:00
|
|
|
import { addCallback, Utils } from 'meteor/nova:core';
|
2016-11-14 17:17:44 +09:00
|
|
|
|
|
|
|
// ------------------------------------- comments.edit.sync -------------------------------- //
|
|
|
|
|
|
|
|
function CommentsEditGenerateHTMLBody (modifier, comment, user) {
|
|
|
|
// if body is being modified, update htmlBody too
|
|
|
|
if (modifier.$set && modifier.$set.body) {
|
2016-12-12 11:34:28 +09:00
|
|
|
modifier.$set.htmlBody = Utils.sanitize(marked(modifier.$set.body));
|
2016-11-14 17:17:44 +09:00
|
|
|
}
|
|
|
|
return modifier;
|
|
|
|
}
|
2016-12-13 11:40:24 +09:00
|
|
|
addCallback("comments.edit.sync", CommentsEditGenerateHTMLBody);
|