[chore] Apply lint and formatter

This commit is contained in:
Cohee
2024-11-11 22:36:06 +02:00
parent 664a531c22
commit a9aff676ba

View File

@ -410,13 +410,13 @@ async function translate(text, lang) {
const chunks = text.split(/!\[.*?]\([^)]*\)/); const chunks = text.split(/!\[.*?]\([^)]*\)/);
const links = [...text.matchAll(/!\[.*?]\([^)]*\)/g)]; const links = [...text.matchAll(/!\[.*?]\([^)]*\)/g)];
let r = ""; let result = '';
for (let i = 0; i < chunks.length; i++) { for (let i = 0; i < chunks.length; i++) {
r += await translateInner(chunks[i], lang); result += await translateInner(chunks[i], lang);
if (i < links.length) r += links[i][0]; if (i < links.length) result += links[i][0];
} }
return r; return result;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
toastr.error(String(error), 'Failed to translate message'); toastr.error(String(error), 'Failed to translate message');