浏览代码

Detect unknown interwiki links properly

Markus-Rost 3 年之前
父节点
当前提交
c6780d1c0f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      util/functions.js

+ 2 - 2
util/functions.js

@@ -179,7 +179,7 @@ function htmlToPlain(html, includeComments = false) {
 			if ( tagname === ignoredTag ) ignoredTag = '';
 		},
 		oncomment: (commenttext) => {
-			if ( includeComments && /^(?:IW)?LINK'" \d+:\d+$/.test(commenttext) ) {
+			if ( includeComments && /^(?:IW)?LINK'" \d+(?::\d+)?$/.test(commenttext) ) {
 				text += '*UNKNOWN LINK*';
 			}
 		}
@@ -365,7 +365,7 @@ function htmlToDiscord(html, pagelink = '', ...escapeArgs) {
 			}
 		},
 		oncomment: (commenttext) => {
-			if ( pagelink && /^(?:IW)?LINK'" \d+:\d+$/.test(commenttext) ) {
+			if ( pagelink && /^(?:IW)?LINK'" \d+(?::\d+)?$/.test(commenttext) ) {
 				text += '*UNKNOWN LINK*';
 			}
 		}