@nextcloud/vue
Version:
Nextcloud vue components
22 lines (21 loc) • 635 B
JavaScript
;
const linkifyStr = require("linkify-string");
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
const linkifyStr__default = /* @__PURE__ */ _interopDefault(linkifyStr);
function Linkify(text) {
return linkifyStr__default.default(text, {
defaultProtocol: "https",
target: "_blank",
className: "external linkified",
attributes: {
rel: "nofollow noopener noreferrer"
}
});
}
const directive = (el, binding) => {
if (binding.value?.linkify === true) {
el.innerHTML = Linkify(binding.value.text);
}
};
module.exports = directive;
//# sourceMappingURL=Linkify.cjs.map