Files
talk/plugins/talk-plugin-rte/server/hooks.js
T
2018-02-21 16:37:19 -03:00

14 lines
312 B
JavaScript

const TurndownService = require('turndown');
module.exports = {
RootMutation: {
createComment: {
async pre(_, { input }, _context, _info) {
// Saving the HTML comment as Markdown
const ts = new TurndownService();
input.body = ts.turndown(input.body);
},
},
},
};