Dear all,

I've created a tag to wrap email addresses into some JavaScript as follows: MAILTO{name,host} is replaced by <script type="text/javascript">var email="%name"+unescape("%40")+"%host"; document.write("<a href='mailto:"+email+"'>"+email+"</a>");</script>.

This works fine until I use the tag several times on the same page. For instance:

1... $MAILTO{user1,host1}$ ...1
2... $MAILTO{user2,host2}$ ...2
3... $MAILTO{user3,host3}$ ...3
4... $MAILTO{user4,host4}$ ...4

In the situation, only the first tag is interpreted, its first parameter is set to

user1,host1}$ ...1
2... $MAILTO{user2,host2}$ ...2
3... $MAILTO{user3,host3}$ ...3
4... $MAILTO{user4

and its second parameter to host4.

Presumably the regexp that parses the tag is greedy and gets text until the last occurrence of }$ in the page... If this is actually a regexp problem, I would expect that this can be fixed using either a non-greedy .* regexp (like .*? in Perl)or, better, a narrower regexp like [^}$]*... But I'm not good enough with PHP in order to go into the module's code... And unfortunately, I've found no workaround yet...

Thanks for any help!
Franck

Comments

profix898’s picture

Status: Active » Fixed

Should be solved in the latest -dev version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.