General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old January 23rd, 2003, 09:28 PM
guitarnoise guitarnoise is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 32 guitarnoise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
WYSIWYG Editor and MicroSoft Markup

Hi all,
I'm using the WYSIWYG Editor from the DevArticles tutorial. My clients keep posting stuff they copied from MicroSoft Word and it ends up containing all the markup that can be found in a typical MS document. Not only is it bloating the file size but it interferes with the CSS as different clients may be using different fonts for their documents.

I've told them to save everything to text first and then post, but they are not listening. Is there a way of getting all the MS rubbish cut from the IFRAME or am I stuck with it? At the moment I have to go in and manually clean everything up. I just want simple <p></p> tags, not the lengthy ones used in Word.
__________________
Without me my guitar is useless
--
http://www.guitarnoise.com
http://www.musiccareers.net

Reply With Quote
  #2  
Old January 24th, 2003, 04:12 AM
Jeb. Jeb. is offline
"l33t? What's l33t?"
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 51 Jeb. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to Jeb.
Hoo......I don't know of any quick method, but I'm certain it would involve a fair bit of regular expression work to parse all that pointless junk out.

If I'm not mistaken there's a program called "tidy" in existance which can easily remove all the unnecessary Word HTML markup. You could pipe the HTML code through that program first using PHP's exec() command, and then store the cleaned code.

Hope that gave you a bit of an idea,
-Jeb.
__________________
Jeb.

AIM: JebediahMc - PM Me - E-Mail Me


Reply With Quote
  #3  
Old January 24th, 2003, 08:53 PM
guitarnoise guitarnoise is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 32 guitarnoise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thanks Jeb.

My first idea was to use regular expressions. But boy, what a variety of Junk MS code uses. It will be tedious and time consuming to catch most of it.

I will look into using a tidy program. Though it does sound like more trouble than it's worth. I could change back to a regular textarea box in a matter of minutes and be done with it.

Reply With Quote
  #4  
Old February 9th, 2003, 08:05 AM
guitarnoise guitarnoise is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 32 guitarnoise User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Well, the easiest route was to train everyone to use Dreamweaver and clean up MS HTML rather than simply cutting and pasting from Word.

It works, but having to train clients on Dreamweaver kind of defeats some of the purpose. Anyone else experienced this?

Reply With Quote
  #5  
Old February 9th, 2003, 06:45 PM
Kiwi Kiwi is offline
Guru-in-training
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Not where I want to be...yet!
Posts: 38 Kiwi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
You could use the strip_tags() function to clear out everything except the tags you want to allow prior to inserting the text into your database. I've tested this out using basic word docs and it seems to work ok. For complex documents I'm not sure how well this works.

Reply With Quote
  #6  
Old February 18th, 2003, 08:23 AM
arrowhead arrowhead is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Kuala Lumpur
Posts: 13 arrowhead User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm having similar problems as well.

When I copy & paste articles or huge blocks of text from Ms-Word into the WYSIWYG iframe, the script returns an "Undefinex index" error, pointing to the hidden form variable that is supposed to hold the iframe contents.

The application works perfectly, however, when I key in plain text and do all the formatting via the WYSWIYG editor itself. It also works nicely if I copy and paste tiny little chunks of text from Ms-Word, eg 1 paragraph or two.

Has anyone experienced similar problems? Does a "hidden" form field contain limitations to the amount of characters that it can hold?

Any feedback will be much appreciated.

Thank you!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > WYSIWYG Editor and MicroSoft Markup


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway