fix: Copying mention should paste full url

This commit is contained in:
Tom Moor committed 2025-01-12 22:15:04 -05:00
1 parent 05b3a39f4d
commit d76cb3bd17
1 file changed
+5 -1
+5 -1
View File
@@ -8,6 +8,7 @@ import {
import { Command, TextSelection } from "prosemirror-state";
import * as React from "react";
import { Primitive } from "utility-types";
import env from "../../env";
import { MentionType } from "../../types";
import { MentionDocument, MentionUser } from "../components/Mentions";
import Extension from "../lib/Extension";
@@ -80,7 +81,10 @@ export default class Mention extends Extension {
},
String(node.attrs.label),
],
toPlainText: (node) => `@${node.attrs.label}`,
toPlainText: (node) =>
node.attrs.type === MentionType.User
? `@${node.attrs.label}`
: `${env.URL}/doc/${node.attrs.modelId}`,
};
}