@mocanvas/mocanvas · function

createBookmarkFromUrl

declare function createBookmarkFromUrl(editor: Editor, { url, center }: {
    url: string;
    center?: VecLike;
}): Promise<CreateBookmarkResult>

Create a bookmark shape for url, centred on center.

Fails — rather than creating an empty card — when the url is unparseable or the editor has no bookmark shape registered, because in both cases there is nothing meaningful to put on the canvas.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.