diff --git a/src/mfm/language.ts b/src/mfm/language.ts index 5faa08fd9e..c5cdb5e3ee 100644 --- a/src/mfm/language.ts +++ b/src/mfm/language.ts @@ -167,10 +167,7 @@ export const mfmLanguage = P.createLanguage({ url = match[0]; } url = removeOrphanedBrackets(url); - while (url.endsWith('.') || url.endsWith(',')) { - if (url.endsWith('.')) url = url.substr(0, url.lastIndexOf('.')); - if (url.endsWith(',')) url = url.substr(0, url.lastIndexOf(',')); - } + url = url.replace(/[.,]*$/, ''); return P.makeSuccess(i + url.length, url); }).map(x => createLeaf('url', { url: x })); },