fix: #11664, dont create backlinks for quotes

This commit is contained in:
Barış Soner Uşaklı
2023-06-01 13:48:12 -04:00
parent b5ee02474f
commit d3c5a79d44
2 changed files with 28 additions and 1 deletions

View File

@@ -373,8 +373,13 @@ module.exports = function (Topics) {
throw new Error('[[error:invalid-data]]');
}
let { content } = postData;
// ignore lines that start with `>`
content = content.split('\n').filter(line => !line.trim().startsWith('>')).join('\n');
// Scan post content for topic links
const matches = [...postData.content.matchAll(backlinkRegex)];
const matches = [...content.matchAll(backlinkRegex)];
console.log('match', matches);
if (!matches) {
return 0;
}