Code Blue
September 13, 2009 3:01 PM   Subscribe

Why, when I cut and paste original Word docs into my blog, does all this hidden html code (or something) show up?

At first I thought it was just stuff I copied off the web, but it's doing it with original writing created entirely, by me, in Word, as well. Here's one sample (screen shot, because when I tried to post it here, it stripped all the code out. On Blogspot, it just tells me it can't post because of the code).

This started happening a couple of months ago. I have to strip out all the code before publishing. I did not put ANY of that code in there. I wouldn't know how if I wanted to. What is going on, and why is this happening.

(Note-- I know NOTHING about computer code, so super-simple response please.)
posted by nax to Computers & Internet (20 answers total) 2 users marked this as a favorite
 
It's something Word does automatically. Type your text in WordPad and then copy-paste.
posted by orrnyereg at 3:03 PM on September 13, 2009


Response by poster: Well how annoying. I am a 53-year old immigrant to the computer age. What's "WordPad?"
posted by nax at 3:06 PM on September 13, 2009


Wordpad is the default word processor included on Windows. It's probably under accessories.
posted by kylej at 3:08 PM on September 13, 2009


Google WordPad and you have your answer.
posted by dfriedman at 3:10 PM on September 13, 2009


Best answer: There's also a plugin you can download from Blogger that lets you use MS Word, with the controls you're already accustomed to, to create a post and upload it directly. I've used it from time to time.
posted by bunnycup at 3:31 PM on September 13, 2009


You ask why it does that. Short answer, because it's formatted text, not plain text. If you save your file in Word as a .txt file (plain text) it should be fine on your blog. There are other options under "save as" so if plain text isn't what your blog site likes, you can probably find one in there that works.
posted by Listener at 3:33 PM on September 13, 2009


Some of the WYSIWYG editors for blogs and such (e.g., TinyMCE) have Paste From Word buttons that will strip out most of the MS garbage.
posted by bricoleur at 3:35 PM on September 13, 2009


Listener: You ask why it does that. Short answer, because it's formatted text, not plain text. If you save your file in Word as a .txt file (plain text) it should be fine on your blog. There are other options under "save as" so if plain text isn't what your blog site likes, you can probably find one in there that works.

This is true if you're importing; but note that unfortunately (in my experience at least) saving it as a different format won't help in this case, since you're copying and pasting, and since as far as I can tell Word always maintains the formatting in copy and paste even after you save it as plaintext or rtf. (When you use .txt or .rtf, Word is always hoping and begging you to change your mind and save the document as some ridiculous quasi-proprietary thing like .docx; it pretends that it's scared to death that you'll lost your formatting, but really it's just nepotism.)

I think maybe the only way to get text from word to the blog without formatting cruft and without a plugin that does it for you would be to copy your text from Word, open up Notepad, paste the text there, copy it again, and then paste it in the blog.
posted by koeselitz at 4:07 PM on September 13, 2009


WYSIWYG is "What you see is what you get", by the way.

I'm not certain, but looking at your screenshot I think you're using a Mac. I'm sure you know if you are. :) If so, the default text editor on a Mac is TextEdit. I don't have a Mac handy to tell you how to get to it, but you may know already. Apologies, I haven't had a mac since before OS X.

The text field in the browser is expecting plain old text without any of the extra frippery that Word's putting there. You can either have MS Word take it out by saving as plain text, or compose these things in an editor which won't do that.

posted by RikiTikiTavi at 4:11 PM on September 13, 2009


The windows clipboard is actually pretty complicated. When you copy something from a program like word, you're actually copying multiple copies of on the clipboard. Then, whenever you paste it into another program, that program has to pick which version it wants.

So when you copy something out of word, it will actually store a few different versions. One version will hold the plain text, another version will store HTML, and another version will store the text in words normal format.

Ordinarily when you paste into a text box on a web page, only the plain text version will get pasted in, but sometimes web pages will request the HTML version, if there is one. The strange code you see is HTML markup that Microsoft word generates.

Easiest way to get rid of extra junk on your clip board is to paste it into a plain text editor, then copy it back out again. So, if you paste into a program called Notepad notepad will take only the plain text copy, since that's all that notepad deals with. Then, you can copy it back out of notepad and since notepad only holds plain text, you only have one copy on your clipboard -- the plain text one.

Notepad is an even simpler program then WordPad, it opens faster (although that's kind of irrelevant now) and it deals only with plain text, no formatting at all (wordpad can edit plain text as well as formated documents)
posted by delmoi at 4:13 PM on September 13, 2009 [1 favorite]


To start notepad or wordpad, you can usually find it in the 'accessories' program group or just use the run dialog box in windows and run 'notepad.exe' or 'wordpad.exe'. In vista you should be able to just type 'notepad' or 'wordpad' into the search bar on the start button as well.
posted by delmoi at 4:15 PM on September 13, 2009


Again, these people telling to use notepad or wordpad are assuming you're using Windows. If you're on a Mac, you won't find those programs and would be looking for something like TextEdit, the Mac's built-in text editor. Apologies if that's obvious to you; I'm trying not to assume anything.
posted by RikiTikiTavi at 4:25 PM on September 13, 2009


Best answer: If you don't know where to find another text editor on your computer, you can use a text entry field, like the MetaFilter comment fields, or Google Language Tools conversion field to dump text in and copy it back out. These fields don't store extra formatting information, so you should get plain text in your blog. It's round-about, but it works (I do this at work, but with Notepad, to strip out weird formatting that does weird things in Word and other Microsoft document programs).
posted by filthy light thief at 5:10 PM on September 13, 2009


The best answer is to get used to writing in the plain-text environment from the outset. Notepad is OK, but NoteTab or TextMate will give you a lot more tools to help.
posted by yclipse at 6:06 PM on September 13, 2009


Response by poster: Yes, I'm on a Mac. I am awed that you can tell. To me, they're all just fancy typewriters, although my kids tell me I'm waaaaay ahead of the curve on other mothers my age.
posted by nax at 6:22 PM on September 13, 2009


Response by poster: No RTT, treat me like I'm stupid, otherwise you'll say something that goes over my head (apologies for the double, didn't finish the thread. But then, it's my thread.)
posted by nax at 6:24 PM on September 13, 2009


Since I always have MetaFilter open, when I'm copy-pasting from word I always first paste into the empty "comment" field in the thread was last reading. Then I copy THAT and paste into wherever it's going. That weeds out all the HTML.

And so far, I have never wound up posting an entire Word doc as a comment... Yet.
posted by hermitosis at 8:35 PM on September 13, 2009


I haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaate this. Just write it in Word, copy/paste to Wordpad, then copy/paste to your blog. Alternately, just write directly in Wordpad.
posted by GilloD at 9:00 PM on September 13, 2009


What's interesting to me is that you and I both had this start happening this summer, when previously we were able to paste things into submission boxes just fine from Word on a Mac. Out of curiosity: What version of the Mac operating system are you using? (To find out, go to the apple menu, then choose "About This Mac." Immediately below where it says Mac OS X it should have the version number.)

I've been wondering whether Word had some automatic update at some point that made this somehow more of an issue. In any case, the posters above have it—just copy your text in Word, then paste it into a blank submission form or a basic word-processing app like TextEdit, then paste into the form you want to submit it to and it should work.
posted by limeonaire at 10:07 PM on September 13, 2009


Response by poster: Mac OS X: Version 10.5.8

Saving as .txt seems to work with the fewest steps. Thanks for both the advice and the reassurance that I wasn't copying something untoward from the dark side of the intarwebs. Hugs for all (as everyone needs one!) I leave this unresolved for now, in case anyone comes in with any thing else. MeMail if you want to see the blog(s), always interested in new victims!
posted by nax at 10:40 AM on September 14, 2009


« Older Would it be unwise to get a private pilot's...   |   york u --> humber river regional? Newer »
This thread is closed to new comments.