Skip to content
Snippets Groups Projects
Commit 4dffce22 authored by Christophe's avatar Christophe
Browse files

fix(ClickableLinks): replaceAll, not just once

parent 64f2b9d9
No related branches found
No related tags found
1 merge request!10Update ai4eosc branch with recent main (multiple templates)
......@@ -6,8 +6,8 @@ type ClickableLinksProps = {
const ClickableLinks: FC<ClickableLinksProps> = ({ text }) => (
<span
dangerouslySetInnerHTML={{
__html: text.replace(
/(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&//=]*))/,
__html: text.replaceAll(
/(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&//=]*))/g,
'<a href="$1">$1</a>'
),
}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment