mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-25 05:02:57 +01:00
Drop all trailing punctuations from URLs in a pasted text
This matches the common behaviour of various places, e.g. GitHub and Slack.
This commit is contained in:
parent
6b04961654
commit
0b45e6112c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user