返回 oh-my-ppt
edit-output.ts
根目录 / src / shared / edit-output.ts
1 const INTERNAL_EDIT_CONFIRMATION_PATTERNS = [
2 /(?:未修改|没有修改|不会修改)\s*index\.html(?:\s*(?:或|和|以及)\s*其他页面)?[。.!!]?/gi,
3 /index\.html\s*(?:未被修改|没有被修改|不会被修改)(?:\s*(?:,|,)?\s*(?:其他页面也)?(?:未被修改|没有被修改))?[。.!!]?/gi,
4 /(?:did not|didn't|will not|won't)\s+modify\s+index\.html(?:\s+(?:or|and)\s+other pages)?[.!]?/gi,
5 /index\.html\s+(?:was not|wasn't|will not be|won't be)\s+modified[.!]?/gi
6 ]
7
8 export function stripInternalEditConfirmations(value: string): string {
9 let result = value
10 for (const pattern of INTERNAL_EDIT_CONFIRMATION_PATTERNS) {
11 result = result.replace(pattern, '')
12 }
13 return result
14 .replace(/[ \t]+\n/g, '\n')
15 .replace(/\n{3,}/g, '\n\n')
16 .replace(/^[\s·,,;;::-]+|[\s·,,;;::-]+$/g, '')
17 .trim()
18 }
19
19 lines TYPESCRIPT