quill-fire

Extend Quill JS editor to fire events as soon as matching text is entered!

MIT License

Downloads
5
Stars
3
Committers
2

quill-fire

Extend Quill JS editor to fire events as soon as matching text is entered!

Available on NPM at: https://www.npmjs.com/package/quill-fire

Example usage:

const fire: FireOptions = {
  items: [
    {
      action: () => {
        console.log("Found!");
        return null;
      },
      matchString: "/",
      prefix: /([\s.?!)]+$)|(^$)/,
      ignoreCase: true,
    },
    {
      action: () => {
        console.log("Found case insensitive string: MATCH");
        return null;
      },
      matchString: "MATCH",
      ignoreCase: true,
      prefix: /\s+$/,
      removeMatchingText: true,
    },
    {
      action: () => {
        console.log("Found case sensitive string: caSeTest");
        return null;
      },
      matchString: "caSeTest",
      removeMatchingText: false,
      ignoreCase: false,
    },
    {
      action: () => {
        console.log("Found exact string Bar after string FOO");
        return null;
      },
      prefix: /FOO$/,
      matchString: "Bar",
      removeMatchingText: false,
      ignoreCase: false,
    },
  ],
};