Merge pull request #287 from StickyKnow/fix-link-pattern

fix link pattern to also detect new (longer) top level domains
This commit is contained in:
Philipp Kühn
2019-05-07 07:50:18 +02:00
committed by GitHub

View File

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