Sign in to follow this  

[web] Javascript help please?

Recommended Posts

function stripTags(s){
 s = s.replace(/<br \/>/gi,"\r");
 s = s.replace(/<br\/>/gi,"\r");
 s = s.replace(/
/gi,"\r"); s = s.replace(//gi,""); s = s.replace(/<\/i>/gi,""); s = s.replace(//gi,""); s = s.replace(/<\/b>/gi,""); s = s.replace(/
"); s = s.replace(/<\/blockquote>/gi,"
"); s = s.replace(/

/gi,""); s = s.replace(/<\/p>/gi,""); s = s.replace(/<\/a>/gi,""); s = s.replace(/]*>/gi,"[img]$1[/img]"); s = s.replace(/(.+?)<\/a>/gi,"[url=$1]$2[/url]"); s = s.replace(/<.*\/>/gi,""); s = s.replace(/<.*>/gi,""); s = s.replace(/<\/.*>/gi,""); while(s != s.replace(/\r[\s]*\r/gi,"\r")){ s = s.replace(/\r[\s]*\r/gi,"\r"); }

Here is my quick script to change html to bbcode. and here is the line in question s = s.replace(/(.+?)<\/a>/gi,"[url=$1]$2[/url]"); Can I have some assistance so that when a href="blah">words I get [url=blah +]+words etc. Thank - oyu for any help.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this