UNPKG

@edifice.io/tiptap-extensions

Version:
3 lines (2 loc) 915 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const extensionLink=require("@tiptap/extension-link"),Hyperlink=extensionLink.Link.extend({name:"hyperlink",parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])',getAttrs:node=>{if(node.getAttribute("data-id")&&node.getAttribute("data-app-prefix"))return!1}}]},addOptions(){var _a,_b;return{...(_a=this.parent)==null?void 0:_a.call(this),openOnClick:!1,HTMLAttributes:{...(_b=this.parent)==null?void 0:_b.call(this).HTMLAttributes,target:null}}},addAttributes(){var _a;return{...(_a=this.parent)==null?void 0:_a.call(this),target:{default:this.options.HTMLAttributes.target,parseHTML:element=>element.getAttribute("target")!=="_blank"?null:"_blank",renderHTML:attributes=>({target:attributes.target})},title:{default:this.options.HTMLAttributes.title}}}});exports.Hyperlink=Hyperlink; //# sourceMappingURL=hyperlink.cjs.map