Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2004, 02:07 AM
Authorized User
 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Convert back from tag [] to <>

Does anyone know what is the function that will convert back tags from [] to <>?
Thank you very much. I'm very appreciate it.

 
Old August 9th, 2004, 06:59 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Do you want to convert [] tags to <> in html page or need javascript to do this?


Om Prakash
 
Old August 9th, 2004, 11:23 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Are you looking for a BBCode parser? This is usually done on the server-side, though I don't see any reason it couldn't be done with JavaScript, I think that a server-side parser is more appropriate.

I use a PHP-based solution.
http://pear.php.net/package/HTML_BBCodeParser

I found that this package is pretty customizable, meaning additional tags and options aren't very difficult to add to it.

For an ASP-based solution, perhaps something like Snitz would work.
http://forum.snitz.com

Being an open-source forum package you could download the code and extract the relavent code for BBCode parsing.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old August 9th, 2004, 08:35 PM
Authorized User
 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi! I need javascript to convert this tags.

 
Old August 9th, 2004, 09:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Didn't Chris already solve your problem in the topic this is a cross-post of?

Quote:
quote:Originally posted by ChrisScott
function RevertTags(pHtml){
    return pHtml.replace(/\[([^\]]*)\]/g, "<$1>");
}
Snib

<><
 
Old August 9th, 2004, 09:44 PM
Authorized User
 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ya.... but what is the function to open text file for wysiwyg editor and then convert the tags? Thanks a lot. :)

 
Old August 10th, 2004, 04:32 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Cross-post with:
http://p2p.wrox.com/topic.asp?TOPIC_ID=17176
http://p2p.wrox.com/topic.asp?TOPIC_ID=17355
http://p2p.wrox.com/topic.asp?TOPIC_ID=17129

Please post replies to this thread!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old August 10th, 2004, 09:05 PM
Authorized User
 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you guys know where to download the full function of wysiwyg editor and coding as well? I want the open and save project function so. Thank you very much. It was very much appreciated.

 
Old August 10th, 2004, 10:43 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Doing a WYSIWYG with Javascript is a complicated undertaking, its not possible to explain everything involved in a few posts to a forum. Furthermore, everyone has projects of their own, why should we spend hours doing your work?? What you have in mind requires an array of regular expressions, and as far as opening and modifying files I don't think that's possible without a server-side technology of some kind. If it is possible, it would require very low security settings on the client computer.

I would suggest looking at already built solutions. I found this one and after looking over the demo I quite like it. It's a cross-platform, client-side WYSIWYG that produces XHTML compliant markup.
http://www.fckeditor.net/

If you're determined to do BBCode, then download a server-side solution like the one I suggested and write a javascript version of it! As always, Google is your friend!
http://www.google.com/search?q=WYSIWYG+Javascript

Of course none of these create or have any part in managing the files generated! You still need a server-side technology for that.

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
 
Old August 10th, 2004, 11:15 PM
Authorized User
 
Join Date: Oct 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Rich. I will try.






Similar Threads
Thread Thread Starter Forum Replies Last Post
VB: Insert <p> tag Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 12th, 2007 05:19 AM
<OBJECT> tag in IE doesn't work jtrifts HTML Code Clinic 1 August 30th, 2007 11:36 AM
<a> tag in XML sani723 XSLT 5 March 27th, 2007 04:16 AM
dynamic <input> tag Val Javascript 1 September 6th, 2006 02:55 AM
<Form> tag within <form> tag rit01 ASP.NET 2.0 Basics 3 April 23rd, 2006 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.