Browse Source

Detect unknown interwiki links properly

Markus-Rost 3 years ago
parent
commit
c6780d1c0f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      util/functions.js

+ 2 - 2
util/functions.js

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