kopia lustrzana https://github.com/wagtail/wagtail
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
rodzic
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);
|
||||
|
|
Ładowanie…
Reference in New Issue