mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-18 11:58:24 +01:00
Fix link activation to be able to handle the same link (or email address) multiple times in the content
This commit is contained in:
parent
46d4d3acce
commit
1c6abab9a8
@ -490,14 +490,15 @@ function et2_activateLinks(_content)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split the content string at the given position
|
// Split the content string at the given position(s)
|
||||||
var splitted = _content.split(_matches[0], 2);
|
// but we only handle the first occurence
|
||||||
|
var splitted = _content.split(_matches[0]);
|
||||||
|
|
||||||
// Push the not-matched part
|
// Push the not-matched part
|
||||||
if (splitted[0])
|
if (splitted[0])
|
||||||
{
|
{
|
||||||
// activate the links of the left string
|
// activate the links of the left string
|
||||||
arr = arr.concat(et2_activateLinks(splitted[0]));
|
arr = arr.concat(et2_activateLinks(splitted.shift()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the callback function which converts the matches into an object
|
// Call the callback function which converts the matches into an object
|
||||||
@ -505,7 +506,7 @@ function et2_activateLinks(_content)
|
|||||||
_proc(_matches);
|
_proc(_matches);
|
||||||
|
|
||||||
// Set the new working string to the right part
|
// Set the new working string to the right part
|
||||||
_content = splitted[1];
|
_content = splitted.join(_matches[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user