add comma to the pasteRule pattern of URLs, allow pasting URLs that include a comma

This commit is contained in:
Hans Pagel
2020-09-03 16:47:48 +02:00
parent 692cd4f47e
commit 6f649412c1

View File

@@ -56,7 +56,7 @@ export default class Link extends Mark {
pasteRules({ type }) {
return [
pasteRule(
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi,
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b([-a-zA-Z0-9@:%_+.~#?&//=,]*)/gi,
type,
url => ({ href: url }),
),