Fix code style

This commit is contained in:
syuilo 2019-06-19 17:47:24 +09:00
parent aac519bf80
commit 33d79420eb
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
1 changed files with 4 additions and 2 deletions

View File

@ -157,12 +157,14 @@ export const mfmLanguage = P.createLanguage({
let url: string; let url: string;
if (!match) { if (!match) {
const match = text.match(/^<(https?:\/\/.*?)>/); const match = text.match(/^<(https?:\/\/.*?)>/);
if (!match) if (!match) {
return P.makeFailure(i, 'not a url'); return P.makeFailure(i, 'not a url');
}
url = match[1]; url = match[1];
i += 2; i += 2;
} else } else {
url = match[0]; url = match[0];
}
url = removeOrphanedBrackets(url); url = removeOrphanedBrackets(url);
while (url.endsWith('.') || url.endsWith(',')) { while (url.endsWith('.') || url.endsWith(',')) {
if (url.endsWith('.')) url = url.substr(0, url.lastIndexOf('.')); if (url.endsWith('.')) url = url.substr(0, url.lastIndexOf('.'));