mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-03 01:08:05 +09:00
Refactor removal of trailing comma/period (#5434)
* Refactor removal of trailing comma/period * Use regex
This commit is contained in:
parent
f1753c3958
commit
fbe9264a25
@ -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 }));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user