@witchcraft/editor
    Preparing search index...

    Interface AdditionalLinkOptions

    interface AdditionalLinkOptions {
        isInternalLink: (href: string) => boolean;
        openExternal: (href: string) => void;
        openInternal: (href: string) => void;
        openLinkOnClickModifier: "ctrlKey" | "shiftKey" | "altKey" | "metaKey";
    }
    Index

    Properties

    isInternalLink: (href: string) => boolean

    Returns true if the given href is an internal link.

    Note this should check if the internal link is in a valid format and prevent xss attacks. Usually just making it a simple format is enough.

    The default one checks against the regex /internal://[0-9a-zA-Z_-]+/

    openExternal: (href: string) => void

    How to open external links.

    The default is to open the link in a new tab.

    This can be changed using setLinkOpts to set a different function.

    openInternal: (href: string) => void

    How to open internal links.

    The default is just to log the link to the console and warn to set the function which should be set with setLinkOpts

    openLinkOnClickModifier: "ctrlKey" | "shiftKey" | "altKey" | "metaKey"