Dear forum,

Help request.

Ok on my site I am about to begin a collaborative playwriting project on the 1st of March. This means that three writers will need to post almost everyday on the site using the book.module.

Now in the past I have written various messages on these forums concerning text editing:

http://drupal.org/node/17489
http://drupal.org/node/8264
http://drupal.org/node/16420

I thank all of you who took time to answer these questions. However I am still in a quandry becasue not one solution offers complete stability and ease of use for the writers on my site (who tend not to be so computer savvy).

Becasue text submission is going to be the key to the success of these projects I am desperate to find a solution. Since most of the writers use MS Word to script entries all I really need is a way to copy and paste from word documents without issues of formatting and distortion of code. I would happily give up the whole wysiwyg text interface for a simple copy and paste word function if it meant people could be confident about posting on my site.

Do you guys know anyway this could be accomplished. Time is ticking and anxiety is growing. I really hope I can find a viable solution.

Thanks for reading.

Yours,

FrancisQ.

Comments

neofactor’s picture

On a past Project I had to write a code sweeper to strip out all the extra MS Word code that a user might paste. It took me a while to write it but saved me so much time in the end with the clients.

The code below is Coldfusion but the concept is the same... basic replace calls using Regular Expressions (A pain to write in but the best way to do anything):
DRUPAL Blocked my code so here is a link: http://www.neofactor.com/files/misc/html_code_sweeper.txt

It "should be easy" to port it over to PHP and add it as a module.

The code I wrote above it pretty harsh though. I ripped out everything so they were left with just the text and no color, formatting... nothing.

Let me know if you or anyone else goes anywhere with this in PHP.

:)

AndrewE’s picture

Neo factor that sounds like exactly what i need, a code sweeper. So that when a user copies from an MS Word doc and pastes on the basic drupal text area the orginal text stays the same and does not drive the whole site crazy!

Basically for my purposes, I just need for italics, bold type and general layout formatting (spaces, linebreaks and indents) to be kept while the rest can be stripped away.

However I am a total noob to PHP and wouldn't have a clue how to port what you suggested into a module.

Is there anyway someone might be willing to assist me in such an endeavour?

Please let me know if you can help, I would be extremely grateful. And will do all I can in return.

Thanks alot,

FrancisQ

The Green Room