carbon-react
Version:
A library of reusable React components for easily building user interfaces.
2 lines (1 loc) • 658 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@lexical/react/LexicalAutoLinkPlugin");require("react");const r=RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),a=[t.createLinkMatcherWithRegExp(r,(e=>e.startsWith("http")?e:`https://${e}`)),t.createLinkMatcherWithRegExp(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,(e=>`mailto:${e}`))];exports.default=()=>e.jsx(t.AutoLinkPlugin,{matchers:a});