Drop all trailing punctuations from URLs in a pasted text

This matches the common behaviour of various places, e.g. GitHub and
Slack.
pull/12433/head
Sage Abdullah 2024-10-21 16:32:47 +01:00
rodzic 6b04961654
commit 0b45e6112c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: EB1A33CC51CC0217
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -148,7 +148,7 @@ const insertContentWithLinks = (editorState, htmlOrText) => {
// For example "Go to https://example.com."
// Terminal Punctuation class: see https://www.unicode.org/review/pr-23.html.
const cleanURLPattern = match[1].replace(
/\p{Terminal_Punctuation}$/u,
/\p{Terminal_Punctuation}+$/u,
'',
);
const url = getValidLinkURL(cleanURLPattern);