0.3.0 • Published 3 years ago

quill-linkify v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Quill Linkify

Quill plugin that converts URL, mail address, phone number to link.

Install

yarn add quill-linkify

How to use

import Quill from 'quill';
import { Linkify, Options } from 'quill-linkify';

Quill.register('modules/linkify', Linkify);

const linkifyOptions: Options = {
  /* custom (regexp or true) or (false or undefined) */
  url: /foo/, // Use custom regexp
  mail: true, // Use default regexp
  phoneNumber: false, // Disable text auto link
};

const quill = new Quill("Element", {
  modules: {
    linkify: linkifyOptions,
    // or true (Use default regep)
  },
});

Default Regular Expression

TypeRegExp
URL/(https?:\/\/\|www\.)[\w-\.]+\.[\w-\.]+(\/([\S]+)?)?/i
Mail/([\w-\.]+@[\w-\.]+\.[\w-\.]+)/i
Phone number/(((0(\d{1}[-(]?\d{4}\|\d{2}[-(]?\d{3}\|\d{3}[-(]?\d{2}\|\d{4}[-(]?\d{1}\|[5789]0[-(]?\d{4})[-)]?)\|\d{1,4}-?)\d{4}\|0120[-(]?\d{3}[-)]?\d{3})/i
0.3.0

3 years ago

0.3.0-0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago