Page 1 of 2

MS Word Paste and comments

Posted: Fri Jul 15, 2005 2:59 am
by psych3
A few of my readers have had this problem. When pasting from MS word into the comments section, it puts into office specific tags which in turn cause the comments texts layout to go haywire.

I am just wondering if there is a way to strip out MS word specific tags on pasting?

Re: MS Word Paste and comments

Posted: Fri Jul 15, 2005 10:20 am
by garvinhicking
Wow. I've never ever heard of people who paste Word-stuff as comments!

The problem is that very deep in the code we make a strip_tags call. That removes all HTML markup formatting. Basically it shouldn't scrubb out any text information. Can you give me an example of what your people paste?

I think that Word has a feature to copy code as plaintext...but I bet that's too hard for your users to figure out. :-/

Regards,
Garvin

Posted: Fri Jul 15, 2005 4:28 pm
by psych3
Yeah my users tend to be a lazy lot :wink: Actually a lot of them coming into the serendipity blog arent that web savvy as is not a technical blog as such.

Perhaps what I can do is modify one of the files and have a little note there to paste as text and with some instructions. Maybe even open a little popup window with help instructions for comment pasting etc..

thanks

Pasting WORD text in new post

Posted: Mon Jul 18, 2005 1:08 am
by Joerg
I don't have this problem with comments, but I do have it with posts.

I write what I have to say in WORD, insert hyperlinks, indent the quotes, then I copy it all and paste it into a new poste (using IE, since pasting does not in Firefox). Often it works out fine, but sometimes the layout does not look correctly: Some paragraphes or words are bigger than others, although I used the same font and the same font size (verdana 10pt) in WORD.

Sometimes the post looks fine in Firefox, but not in IE. This usually happens, when I edit a post online (i.e. no copy and paste again).
Some posts look fine in Ansicht->Schriftgrad->"Mittel", but not in "Groesser".

=> Do I have to stop using WORD to layout my texts and then copy and paste into the blog?

Why have I done it so far? Because typing is faster in WORD. And I take my notes in WORD. And in WORD I can define the space between two paragraps as 0,4pt, while in s9y editor it has to be a full line.

I am running Serendipity v.0.7.1 and I am concerned that I do not manage to update. Well, should I try to update?

This is my blog: http://atlanticreview.org

Thanks

Joerg

Posted: Mon Jul 18, 2005 3:30 am
by psych3
yes its a problem for posts too, as I like to write in word and then cut and paste myself. So perhaps this could be a feature request to strip out all word comments.

Posted: Fri Jul 22, 2005 11:54 pm
by Hathor
Ditto. Drupal has a mod that removes special Word formatting... I was wondering if someone could write something like that for Serendipity?

The problem for me is not the post looking funky - it's that the feed won't validate. Word uses its own code somehow for the following marks:
hyphen -
quote "
apostrophe '
I have several people who post articles by sending them to me as Word attachments. I've tried several shortcuts, but in the end, I just have to copy and paste from Word into the S9 entry box, then hand-replace every one of those marks with the same mark (but typed in via the S9 interface, they work fine), and then post. Otherwise, it wrecks the feed.

I haven't really tried the Drupal mod out too much, so I don't know how it works or even if it's as effective as it should be. But if they can do it, I think S9 should be able to. :)

Posted: Sat Jul 23, 2005 4:07 pm
by garvinhicking
Yes, a plugin using the frontend_display hook to modify contents of $eventData['comment'] would be fairly easy.

Someones want to try it? He/She can use the nl2br or s9ymarkup plugin as a foundation class and make str_replace() calls to replace the ugly characters...
:)

Regards,
Garvin

Posted: Sun Jul 24, 2005 9:33 pm
by Hathor
I wish, but I'm nowhere near being able to write a plug-in. People talk like it's so simple (at other forums, too - Drupal, WP, etc.), but when I read tutorials on it, I get really lost really quickly. :(

But you know, if someone wants to write one for it and I can help by testing it or something, I'd be glad to help anyway I can.

Posted: Mon Jul 25, 2005 9:10 pm
by alphalogic
if you give me a list of all word special formatting tags, i could write a plugin.

Posted: Tue Jul 26, 2005 12:32 am
by Hathor
Cool! The ones I'm aware of are just the symbols for quote marks, apostrophes and hyphens bookended by spaces. Word makes the quotes and apostrophes curly (typing them directly into S9 makes them straight) and it makes the hyphens like - these - a little bit longer than they appear here. Is that what you need? Or do you need me to go into Word code and find something? Please just let me know.

I think other posters here have raised other issues I'm not aware of - hopefully, they'll come in and explain.

Posted: Tue Jul 26, 2005 6:27 pm
by Guest
Hathor wrote:Cool! The ones I'm aware of are just the symbols for quote marks, apostrophes and hyphens bookended by spaces. Word makes the quotes and apostrophes curly (typing them directly into S9 makes them straight) and it makes the hyphens like - these - a little bit longer than they appear here. Is that what you need? Or do you need me to go into Word code and find something? Please just let me know.

I think other posters here have raised other issues I'm not aware of - hopefully, they'll come in and explain.
i need a list of all word tags since i dont have ms word, something like:
<p:o>, <hyphen> ...

Posted: Tue Jul 26, 2005 6:31 pm
by Guest
Anonymous wrote:
Hathor wrote:Cool! The ones I'm aware of are just the symbols for quote marks, apostrophes and hyphens bookended by spaces. Word makes the quotes and apostrophes curly (typing them directly into S9 makes them straight) and it makes the hyphens like - these - a little bit longer than they appear here. Is that what you need? Or do you need me to go into Word code and find something? Please just let me know.

I think other posters here have raised other issues I'm not aware of - hopefully, they'll come in and explain.
i need a list of all word tags since i dont have ms word, something like:
<p:o>, <word:xyz> ...
Quotes, and apostrophes are no prorblem

Posted: Tue Jul 26, 2005 9:59 pm
by Hathor
I'm not sure I know what you mean, but... okay, if I type this in word:

"Blah's - blah - blah blah"

And then copy and paste that into the Serendipity entry box, the quotes and apostrophe will appear as sort of slanted instead of straight, and the hyphens will be longer than normal dashes. Then, if I go into the entry box and simply type OVER each symbol with the very same symbol, it replaces them with the simple version, and that works just fine.

If I leave the slanty Word stuff in, it invalidates the feed.

I'm afraid I'm not being very helpful, but I'll keep trying. :)

Posted: Tue Jul 26, 2005 10:36 pm
by Guest
Hathor wrote:I'm not sure I know what you mean, but... okay, if I type this in word:

"Blah's - blah - blah blah"

And then copy and paste that into the Serendipity entry box, the quotes and apostrophe will appear as sort of slanted instead of straight, and the hyphens will be longer than normal dashes. Then, if I go into the entry box and simply type OVER each symbol with the very same symbol, it replaces them with the simple version, and that works just fine.

If I leave the slanty Word stuff in, it invalidates the feed.

I'm afraid I'm not being very helpful, but I'll keep trying. :)
well i know what you mean :) but thats not what i am asking for
psych3 wrote: A few of my readers have had this problem. When pasting from MS word into the comments section, it puts into office specific tags which in turn cause the comments texts layout to go haywire.
i am asking for the tags psych3 told about, when i know them - the plugin will be done soon :)

Posted: Tue Jul 26, 2005 10:37 pm
by alphalogic
the post with the bad quote was mine :)