Skip to content
Snippets Groups Projects
Commit e94dd8a5 authored by Aya Morisawa's avatar Aya Morisawa Committed by syuilo
Browse files

Refactor removal of trailing comma/period (#5434)

* Refactor removal of trailing comma/period

* Use regex
parent e1450957
No related branches found
No related tags found
No related merge requests found
......@@ -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 }));
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment