Active
Project:
URL Icon
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2008 at 02:26 UTC
Updated:
4 Dec 2008 at 02:26 UTC
Thank you for providing this nice tool.
I got a problem and may have a solution to it.
If an <a> tag without 'http://' is followed by another <a> with 'http://', urlicon combines those 2 <a> together and make only one link for them.
For example, the following HTML code has this problem.
<a href="/node/1">Link1</a> foo bar<a href="http://www.example.com">Link2</a>
The output URL Icon generates is
<a href="http://www.example.com">Link2 <img src="/sites/all/modules/urlicon/Icon_External_Link.png" alt="" title="favicon" class="urlicon urlicon-www_example_com" /></a>
Notice that the Link1 part is missing.
I have a workaround to this problem. I've changed
61: $reg_exp = '/<a.+?href=\"((http|https|ftp|telnet|news|mms):\/\/.+?)\"[^>]*>(.+?)<\/a>/i';
to
61: $reg_exp = '/<a[^>]+?href=\"((http|https|ftp|telnet|news|mms):\/\/.+?)\"[^>]*?>(.+?)<\/a>/i';
I don't know this change works for other cases. I don't know how to make a patch either. So, I can't help active development but hope this information helps.