diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 21a1dfbd..d0624e25 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -100,6 +100,10 @@ export const formatText = (text: string): string => .replace(/(\/\*[\s\S]*?\*\/)/gim, '$1') .replace(/([=|-]{5,})/gim, '
') .replace(/:\|--\|/gim, '://') + .replace( + /(\b(https?|ftp|file):\/\/([-A-Z0-9+&@#%?=~_|!:,.;]*)([-A-Z0-9+&@#%?\/=~_|!:,.;]*)[-A-Z0-9+&@#\/%=~_|])/gi, + '$1' + ) .split('\n') .filter(el => el.trim().length) .join('\n');