mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
feat: refactor link menu (#2025)
* link markview - WIP * WIP * feat: refactor links * cleanup
This commit is contained in:
@@ -6,6 +6,19 @@ import { EditorView } from "@tiptap/pm/view";
|
||||
export const LinkExtension = TiptapLink.extend({
|
||||
inclusive: false,
|
||||
|
||||
addAttributes() {
|
||||
return {
|
||||
...this.parent?.(),
|
||||
internal: {
|
||||
default: false,
|
||||
parseHTML: (element: HTMLElement) =>
|
||||
element.getAttribute('data-internal') === 'true',
|
||||
renderHTML: (attributes) =>
|
||||
attributes.internal ? { 'data-internal': 'true' } : {},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user