···1818import {Plugin, PluginKey} from '@tiptap/pm/state'
1919import {Node as ProsemirrorNode} from '@tiptap/pm/model'
2020import {Decoration, DecorationSet} from '@tiptap/pm/view'
2121+import {URL_REGEX} from '@atproto/api'
2222+2123import {isValidDomain} from 'lib/strings/url-helpers'
22242325export const LinkDecorator = Mark.create({
···78807981function iterateUris(str: string, cb: (from: number, to: number) => void) {
8082 let match
8181- const re =
8282- /(^|\s|\()((https?:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/gim
8383+ const re = URL_REGEX
8384 while ((match = re.exec(str))) {
8485 let uri = match[2]
8586 if (!uri.startsWith('http')) {