Jump to content
  • Advertisement
Sign in to follow this  
gamerking

[web] Javascript help please?

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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(/
/gi,"
Quote:
"); s = s.replace(/<\/blockquote>/gi,"
"); s = s.replace(/

/gi,""); s = s.replace(/<\/p>/gi,""); s = s.replace(/<\/a>/gi,""); s = s.replace(/]*>/gi,"$1"); s = s.replace(/(.+?)<\/a>/gi,"$2"); 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,"$2"); Can I have some assistance so that when a href="blah">words I get [url=blah +]+words etc. Thank - oyu for any help.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!