How to use the @remirror/core.markPasteRule function in @remirror/core

To help you get started, we’ve selected a few @remirror/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / core-extensions / src / marks / italic-extension.ts View on Github external
public pasteRules({ type }: ExtensionManagerMarkTypeParams) {
    return [markPasteRule({ regexp: /(?:^|[^*_])(?:\*|_)([^*_]+)(?:\*|_)/g, type })];
  }
}
github ifiokjr / remirror / @remirror / core-extensions / src / marks / code-extension.ts View on Github external
public pasteRules({ type }: ExtensionManagerMarkTypeParams) {
    return [markPasteRule({ regexp: /(?:`)([^`]+)(?:`)/g, type })];
  }
}
github ifiokjr / remirror / @remirror / core-extensions / src / marks / code.ts View on Github external
public pasteRules({ type }: SchemaMarkTypeParams) {
    return [markPasteRule(/(?:`)([^`]+)(?:`)/g, type)];
  }
}
github ifiokjr / remirror / @remirror / core-extensions / src / marks / strike-extension.ts View on Github external
public pasteRules({ type }: ExtensionManagerMarkTypeParams) {
    return [markPasteRule({ regexp: /~([^~]+)~/g, type })];
  }
}
github ifiokjr / remirror / @remirror / core-extensions / src / marks / italic.ts View on Github external
public pasteRules({ type }: SchemaMarkTypeParams) {
    return [markPasteRule(/(?:^|[^*_])(?:\*|_)([^*_]+)(?:\*|_)/g, type)];
  }
}
github ifiokjr / remirror / @remirror / extension-enhanced-link / src / enhanced-link-extension.ts View on Github external
public pasteRules({ type }: ExtensionManagerMarkTypeParams) {
    return [
      markPasteRule({
        regexp: extractUrl,
        type,
        getAttrs: url => {
          return {
            href: extractHref(getMatchString(url)),
          };
        },
      }),
    ];
  }
github ifiokjr / remirror / @remirror / core-extensions / src / marks / strike.ts View on Github external
public pasteRules({ type }: SchemaMarkTypeParams) {
    return [markPasteRule(/~([^~]+)~/g, type)];
  }
}
github ifiokjr / remirror / @remirror / core-extensions / src / marks / link-extension.ts View on Github external
public pasteRules({ type }: ExtensionManagerMarkTypeParams) {
    return [
      markPasteRule({
        regexp: /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g,
        type,
        getAttrs: url => ({ href: getMatchString(url) }),
      }),
    ];
  }
github ifiokjr / remirror / @remirror / core-extensions / src / marks / link.ts View on Github external
public pasteRules({ type }: SchemaMarkTypeParams) {
    return [
      markPasteRule({
        regexp: /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g,
        type,
        getAttrs: url => ({ href: getMatchString(url) }),
      }),
    ];
  }