|
|
|
@ -76,7 +76,7 @@ module.exports = function (Topics) {
|
|
|
|
|
if (tidToPost[topic.tid]) {
|
|
|
|
|
tidToPost[topic.tid].index = meta.config.teaserPost === 'first' ? 1 : counts[index];
|
|
|
|
|
if (tidToPost[topic.tid].content) {
|
|
|
|
|
tidToPost[topic.tid].content = utils.stripHTMLTags(tidToPost[topic.tid].content, tags);
|
|
|
|
|
tidToPost[topic.tid].content = utils.stripHTMLTags(replaceImgWithAltText(tidToPost[topic.tid].content), tags);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tidToPost[topic.tid];
|
|
|
|
@ -86,6 +86,10 @@ module.exports = function (Topics) {
|
|
|
|
|
return result.teasers;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function replaceImgWithAltText(str) {
|
|
|
|
|
return String(str).replace(/<img .*?alt="(.*?)"[^>]*>/gi, '$1');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleBlocks(uid, teasers) {
|
|
|
|
|
const blockedUids = await user.blocks.list(uid);
|
|
|
|
|
if (!blockedUids.length) {
|
|
|
|
|