mirror of
https://github.com/labring/FastGPT.git
synced 2026-03-07 01:00:33 +08:00
fix: safari reg error
This commit is contained in:
@@ -117,6 +117,6 @@ export const voiceBroadcast = ({ text }: { text: string }) => {
|
||||
|
||||
export const formatLinkTextToHtml = (text: string) => {
|
||||
const httpReg =
|
||||
/(?<!\[.*\]\()((http|https|ftp):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)(?![\)])/gi;
|
||||
/(http|https|ftp):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/gi;
|
||||
return text.replace(httpReg, '<a href="$&" target="_blank">$&</a>');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user