mirror of
https://github.com/outline/outline.git
synced 2026-12-04 18:34:54 +03:00
fix: Direct link to heading lost when pasting (#8749)
This commit is contained in:
1 parent
a48f6c7a85
commit
18bbe6ecf6
1 file changed
+4
-2
@@ -122,6 +122,8 @@ export default class PasteHandler extends Extension {
|
||||
}
|
||||
|
||||
// Is the link a link to a document? If so, we can grab the title and insert it.
|
||||
const containsHash = text.includes("#");
|
||||
|
||||
if (isDocumentUrl(text)) {
|
||||
const slug = parseDocumentSlug(text);
|
||||
|
||||
@@ -133,7 +135,7 @@ export default class PasteHandler extends Extension {
|
||||
return;
|
||||
}
|
||||
if (document) {
|
||||
if (state.schema.nodes.mention) {
|
||||
if (state.schema.nodes.mention && !containsHash) {
|
||||
view.dispatch(
|
||||
view.state.tr.replaceWith(
|
||||
state.selection.from,
|
||||
@@ -178,7 +180,7 @@ export default class PasteHandler extends Extension {
|
||||
return;
|
||||
}
|
||||
if (collection) {
|
||||
if (state.schema.nodes.mention) {
|
||||
if (state.schema.nodes.mention && !containsHash) {
|
||||
view.dispatch(
|
||||
view.state.tr.replaceWith(
|
||||
state.selection.from,
|
||||
|
||||
Reference in new issue
Block a user