File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
apps/cron/src/services/PostService Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -179,11 +179,18 @@ export class PostService implements Service {
179
179
) : Promise < { isSpam : boolean ; reason : string } > {
180
180
const includesCN = / [ \u4e00 - \u9fa5 ] / . test ( text )
181
181
const includesKR = / [ ㄱ - ㅎ | ㅏ - ㅣ | 가 - 힣 ] / . test ( text )
182
+ const includesVN = / [ à á â ã è é ê ì í ò ó ô õ ù ú ý ă đ ĩ ũ ơ ư ạ ả ấ ầ ẩ ẫ ậ ắ ằ ẳ ẵ ặ ẹ ẻ ẽ ế ề ể ễ ệ ỉ ị ọ ỏ ố ồ ổ ỗ ộ ớ ờ ở ỡ ợ ụ ủ ứ ừ ử ữ ự ỳ ỵ ỷ ỹ ] / . test (
183
+ text ,
184
+ )
182
185
183
186
if ( includesCN && ! includesKR ) {
184
187
return { isSpam : true , reason : 'includesCN' }
185
188
}
186
189
190
+ if ( includesVN && ! includesKR ) {
191
+ return { isSpam : true , reason : 'includesVN' }
192
+ }
193
+
187
194
let replaced = text . replace ( / ` ` ` ( [ \s \S ] * ?) ` ` ` / g, '' ) // remove code blocks
188
195
// replace image markdown
189
196
replaced = replaced . replace ( / ! \[ ( [ \s \S ] * ?) \] \( ( [ \s \S ] * ?) \) / g, '' )
You can’t perform that action at this time.
0 commit comments