mirror of https://gitgud.io/fatchan/jschan.git
parent
688d935980
commit
ed8dcacca8
1 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@ |
||||
'use strict'; |
||||
|
||||
process |
||||
.on('uncaughtException', console.error) |
||||
.on('unhandledRejection', console.error); |
||||
|
||||
const Mongo = require(__dirname+'/db/db.js'); |
||||
|
||||
(async () => { |
||||
|
||||
await Mongo.connect(); |
||||
const { Posts } = require(__dirname+'/db/') |
||||
, linkQuotes = require(__dirname+'/helpers/posting/quotes.js') |
||||
, { markdown } = require(__dirname+'/helpers/posting/markdown.js') |
||||
, sanitizeOptions = require(__dirname+'/helpers/posting/sanitizeoptions.js') |
||||
, sanitize = require('sanitize-html'); |
||||
|
||||
const post = await Posts.db.findOne({/*post query here*/}); |
||||
let message = markdown(post.nomarkup); |
||||
const { quotedMessage, threadQuotes, crossQuotes } = await linkQuotes('tech', message, null); |
||||
message = sanitize(quotedMessage, sanitizeOptions.after); |
||||
await Posts.db.updateOne({board:'tech', postId:357}, {$set:{message:message}}); |
||||
|
||||
})(); |
||||
|
||||
|
Loading…
Reference in new issue