|
|
@ -15,11 +15,14 @@ const Mongo = require(__dirname+'/db/db.js'); |
|
|
|
, sanitizeOptions = require(__dirname+'/helpers/posting/sanitizeoptions.js') |
|
|
|
, sanitizeOptions = require(__dirname+'/helpers/posting/sanitizeoptions.js') |
|
|
|
, sanitize = require('sanitize-html'); |
|
|
|
, sanitize = require('sanitize-html'); |
|
|
|
|
|
|
|
|
|
|
|
const post = await Posts.db.findOne({/*post query here*/}); |
|
|
|
const posts = await Posts.db.find({/*query here*/}).toArray(); |
|
|
|
|
|
|
|
await Promise.all(posts.map(async (post) => { |
|
|
|
let message = markdown(post.nomarkup); |
|
|
|
let message = markdown(post.nomarkup); |
|
|
|
const { quotedMessage, threadQuotes, crossQuotes } = await linkQuotes('tech', message, null); |
|
|
|
const { quotedMessage, threadQuotes, crossQuotes } = await linkQuotes(post.board, message, null); |
|
|
|
message = sanitize(quotedMessage, sanitizeOptions.after); |
|
|
|
message = sanitize(quotedMessage, sanitizeOptions.after); |
|
|
|
await Posts.db.updateOne({board:'tech', postId:357}, {$set:{message:message}}); |
|
|
|
console.log(post.postId, message.substring(0,10)+'...'); |
|
|
|
|
|
|
|
return Posts.db.updateOne({board:post.board, postId:post.postId}, {$set:{message:message}}); |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
})(); |
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|