Markus-Rost %!s(int64=3) %!d(string=hai) anos
pai
achega
e2726efb10
Modificáronse 5 ficheiros con 250 adicións e 271 borrados
  1. 1 1
      RcGcDb
  2. 1 0
      dashboard/settings.js
  3. 241 266
      package-lock.json
  4. 1 1
      package.json
  5. 6 3
      util/functions.js

+ 1 - 1
RcGcDb

@@ -1 +1 @@
-Subproject commit 8a26be890697ca501bb1f24eda9da2b4f7b862af
+Subproject commit aa29d1ca88ad91c21294de0896c07a13176684bb

+ 1 - 0
dashboard/settings.js

@@ -378,6 +378,7 @@ function update_settings(res, userSettings, guild, type, settings) {
 				}
 				wiki.updateWiki(body.query.general);
 				if ( !wiki.isFandom() ) {
+					let lang = new Lang(( type === 'default' && settings.lang || row?.guildlang ));
 					let notice = [];
 					if ( body.query.general.generator.replace( /^MediaWiki 1\.(\d\d).*$/, '$1' ) <= 30 ) {
 						console.log( '- Dashboard: This wiki is using ' + body.query.general.generator + '.' );

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 241 - 266
package-lock.json


+ 1 - 1
package.json

@@ -24,7 +24,7 @@
     "full-icu": "^1.4.0",
     "got": "^12.0.1",
     "htmlparser2": "^7.2.0",
-    "npm": "^8.5.0",
+    "npm": "^8.5.3",
     "pg": "^8.7.3"
   },
   "repository": {

+ 6 - 3
util/functions.js

@@ -357,7 +357,7 @@ function htmlToDiscord(html, pagelink = '', ...escapeArgs) {
 				return;
 			}
 			if ( syntaxhighlight && tagname === 'div' ) syntaxhighlight = '';
-			if ( tagname === 'b' ) text += '**';
+			if ( tagname === 'b' || tagname === 'strong' ) text += '**';
 			if ( tagname === 'i' ) text += '*';
 			if ( tagname === 's' ) text += '~~';
 			if ( tagname === 'u' ) text += '__';
@@ -405,8 +405,11 @@ function htmlToDiscord(html, pagelink = '', ...escapeArgs) {
  */
 function escapeFormatting(text = '', isMarkdown = false, keepLinks = false) {
 	if ( !isMarkdown ) text = text.replace( /\\/g, '\\\\' ).replace( /\]\(/g, ']\\(' );
-	if ( !keepLinks ) text = text.replace( /\/\//g, '/\\/' );
-	return text.replace( /[`_*~:<>{}@|]/g, '\\$&' );
+	text = text.replace( /[`_*~:<>{}@|]/g, '\\$&' ).replace( /\/\//g, '/\\/' );
+	if ( keepLinks ) text = text.replace( /(?:\\<)?https?\\:\/\\\/(?:[^\(\)\s]+(?=\))|[^\[\]\s]+(?=\])|[^<>\s]+>?)/g, match => {
+		return match.replace( /\\\\/g, '/' ).replace( /\\/g, '' );
+	} );
+	return text;
 };
 
 /**

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio