@nextcloud/vue
Version:
Nextcloud vue components
23 lines (22 loc) • 749 B
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const linkifyStr = require("linkify-string");
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
const linkifyStr__default = /* @__PURE__ */ _interopDefault(linkifyStr);
const Linkify = (text) => {
return linkifyStr__default.default(text, {
defaultProtocol: "https",
target: "_blank",
className: "external linkified",
attributes: {
rel: "nofollow noopener noreferrer"
}
});
};
const directive = function(el, binding) {
if (binding.value?.linkify === true) {
el.innerHTML = Linkify(binding.value.text);
}
};
exports.default = directive;
exports.directive = directive;