Add support for web links

This commit is contained in:
Paul Frazee 2022-11-18 13:59:17 -06:00
parent 9d13e05dbf
commit 6e2b7a0b90
4 changed files with 67 additions and 30 deletions

View file

@ -108,7 +108,7 @@ export const ComposePost = observer(function ComposePost({
: undefined
const textDecorated = useMemo(() => {
const re = /(@[a-z0-9\.]*)/gi
const re = /(@[a-z0-9\.]*)|(https?:\/\/[\S]+)/gi
const segments = []
let match
let start = 0