This commit is contained in:
@@ -85,6 +85,10 @@ for (const revision of revisions) {
|
||||
const issues = [];
|
||||
const content = revision.contentHtml || '';
|
||||
const body = bodyText(content);
|
||||
const openingParagraphs = [...content.matchAll(/<p>([\s\S]*?)<\/p>/g)]
|
||||
.slice(0, 2)
|
||||
.map((match) => plainText(match[1]))
|
||||
.join(' ');
|
||||
const figures = [...content.matchAll(/<figure>([\s\S]*?)<\/figure>/g)].map((match) => match[1]);
|
||||
const imageSources = [...content.matchAll(/<img[^>]+src="([^"]+)"/g)].map((match) => match[1]);
|
||||
const proseWithoutCode = content
|
||||
@@ -110,6 +114,9 @@ for (const revision of revisions) {
|
||||
if (!/(проблем|ошиб|симптом|сбой|задач)/i.test(body.slice(0, 800))) {
|
||||
issues.push('проблема не названа в начале текста');
|
||||
}
|
||||
if (!/(цен[аы]|стоимост|издержк|затрат|потер|дороже|\bcost\b)/i.test(openingParagraphs)) {
|
||||
issues.push('цена ошибки не названа в первых двух абзацах');
|
||||
}
|
||||
if (proseWithoutCode.includes('undefined') || proseWithoutCode.includes('[object Object]')) {
|
||||
issues.push('в тексте есть след генерации');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user