mirror of
https://github.com/labring/FastGPT.git
synced 2026-04-05 01:05:10 +08:00
perf: http recognition and input textarea
This commit is contained in:
@@ -113,3 +113,9 @@ export const voiceBroadcast = ({ text }: { text: string }) => {
|
||||
cancel: () => window.speechSynthesis?.cancel()
|
||||
};
|
||||
};
|
||||
|
||||
export const formatLinkTextToHtml = (text: string) => {
|
||||
const httpReg =
|
||||
/(?<!\[.*\]\()((http|https|ftp):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?)(?![\)])/gi;
|
||||
return text.replace(httpReg, '<a href="$&" target="_blank">$&</a>');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user