Merge pull request #787 from hanspagel/master

Improve pasteRules for Link mark
This commit is contained in:
Hans Pagel 2020-08-07 14:44:13 +02:00 committed by GitHub
commit 3eea7fc0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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