fix: Heading hash on link dropped when pasting

This commit is contained in:
Tom Moor
2024-01-08 20:23:37 -05:00
parent 7f06ea044a
commit f08c426715
2 changed files with 4 additions and 2 deletions

View File

@@ -178,10 +178,12 @@ export default class PasteHandler extends Extension {
return;
}
if (document) {
const { hash } = new URL(text);
const title = `${
document.emoji ? document.emoji + " " : ""
}${document.titleWithDefault}`;
insertLink(document.path, title);
insertLink(`${document.path}${hash}`, title);
}
})
.catch(() => {