mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
13 lines
510 B
JavaScript
13 lines
510 B
JavaScript
import marked from 'marked';
|
|
import { addCallback, Utils } from 'meteor/vulcan:core';
|
|
|
|
// ------------------------------------- comments.edit.sync -------------------------------- //
|
|
|
|
function CommentsEditGenerateHTMLBody (modifier, comment, user) {
|
|
// if body is being modified, update htmlBody too
|
|
if (modifier.$set && modifier.$set.body) {
|
|
modifier.$set.htmlBody = Utils.sanitize(marked(modifier.$set.body));
|
|
}
|
|
return modifier;
|
|
}
|
|
addCallback("comments.edit.sync", CommentsEditGenerateHTMLBody);
|