Wayne Barron
asked on
var rightText = RegExp.$3 - Need leftText
Hello All;
In my site that Hielo helped me in.
It is JavaScript based, and this function
Of which allows for text on the right side.
I need it to allow text on the left as well.
Basically.
hello, this is a link [url:www.example.com|Example] that you can click on.
Right now, it will not display as a link, as there is text on the left side, it will only display the actually code.
So, what I am needing, is the leftText to be added in.
Any help on this will be great.
Carrzkiss
In my site that Hielo helped me in.
It is JavaScript based, and this function
var rightText = RegExp.$3
case '[url':
var temp=attributes.split('|');
return '<a href="'+temp[0]+'" title="'+temp[1]+'" target="_blank" rel="nofollow">'+temp[1]+'</a>«'+rightText;
Of which allows for text on the right side.
I need it to allow text on the left as well.
Basically.
hello, this is a link [url:www.example.com|Example] that you can click on.
Right now, it will not display as a link, as there is text on the left side, it will only display the actually code.
So, what I am needing, is the leftText to be added in.
Any help on this will be great.
Carrzkiss
If I remember correctly, there were two functions:
process and bbFilter. You need to call proccess passing bbFilter as the the second argument:
It sounds like you are simply calling it as:
process and bbFilter. You need to call proccess passing bbFilter as the the second argument:
Response.Write( process(inputStr, bbFilter) )
It sounds like you are simply calling it as:
Response.Write( process(inputStr) )
ASKER
Hielo.
I am doing it as the 1st one, exactly.
It has been like that since the code was first done.
padas, the whole page is done in JavaScript, I will be unable to change it to vbscript.
Though that is my comfort zone, I cannot change it now.
Maybe in the future, I can look at a possible convert.
I am doing it as the 1st one, exactly.
It has been like that since the code was first done.
padas, the whole page is done in JavaScript, I will be unable to change it to vbscript.
Though that is my comfort zone, I cannot change it now.
Maybe in the future, I can look at a possible convert.
ASKER
Also, to Hielo.
If I do the [[info|Information Here]]
This works no matter where it is located at, in the middle of text, before, after, works perfectly.
It is only the code like what I supplied above, that does not work in the middle, or the end, only the beginning.
If I do the [[info|Information Here]]
This works no matter where it is located at, in the middle of text, before, after, works perfectly.
It is only the code like what I supplied above, that does not work in the middle, or the end, only the beginning.
Can you provide a sample input string?
ASKER
As sample is as I provided above.
Check out [url:www.eperts-exchange.com|Eperts Exchange] for your project needs and help
It does not matter rather there is 1 or many url's on the same line of not, they will not work if there is text on the "LEFT" side of the tag.
Check out [url:www.eperts-exchange.com|Eperts Exchange] for your project needs and help
It does not matter rather there is 1 or many url's on the same line of not, they will not work if there is text on the "LEFT" side of the tag.
Very similar in js http://jsfiddle.net/ECxXF/
var str = "hello, this is a link [url:www.example.com|Example] that you can click on.";
var left1=str.indexOf('[')+5;
var left2=str.indexOf('|');
var right1=str.indexOf('|')+1;
var right2=str.indexOf(']');
document.write (str.substring(left1,left2));
document.write ("<br>");
document.write (str.substring(right1,right2));
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Just tested it in the demo page, and now on my working testing server,
And it works like a champ.
Thanks a bunch Hielo!!
You Rock!!!
And it works like a champ.
Thanks a bunch Hielo!!
You Rock!!!
Open in new window