@nextcloud/vue
Version:
Nextcloud vue components
21 lines (20 loc) • 462 B
JavaScript
import linkifyStr from "linkify-string";
function Linkify(text) {
return linkifyStr(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);
}
};
export {
directive as default
};
//# sourceMappingURL=Linkify.mjs.map