@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
32 lines (31 loc) • 684 B
JavaScript
import { Mark, mergeAttributes } from "@tiptap/core";
import { autolink } from "./autolink.js";
const defaultAttributes = {
class: "d-link d-c-text d-d-inline-block d-wb-break-all",
rel: "noopener noreferrer nofollow"
};
const CustomLink = Mark.create({
name: "CustomLink",
renderHTML({ HTMLAttributes }) {
return [
"a",
mergeAttributes(
this.options.HTMLAttributes,
HTMLAttributes,
defaultAttributes
)
];
},
renderText({ node }) {
return node.attrs.text;
},
addProseMirrorPlugins() {
return [
autolink({ type: this.type })
];
}
});
export {
CustomLink
};
//# sourceMappingURL=custom_link.js.map