Selaa lähdekoodia

Detect unknown interwiki links properly

Markus-Rost 3 vuotta sitten
vanhempi
sitoutus
c6780d1c0f
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  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*';
 			}
 		}