« March 2011 | Main | May 2011 »

April 2011 Archives

April 27, 2011

Cleaning up text copied from a Google doc

I spent 30 minutes of frustration this morning trying to edit text content that I had pasted from a Google doc into a WYSIWYG editor on Marketo. In the Marketo editor, the content came through with all sorts of odd line breaks, mostly at the start of sentences. Simple enough to correct, I thought, so I used the backspace key in the WYSIWYG editor to remove the line breaks and saved my work and went back to email preview mode. But back in preview mode, the linebreaks remained. Additional edits showed the same behavior and it nearly drove me batty.

So I took a closer look at the HTML source of that comes with any text copied out of Google docs, and realized what the problem was. Docs produces standard HTML and CSS, but a lot of it, and there was one inline style declaration all over the place that was causing the problem: white-space: pre-wrap;. Copy the HTML source into a text editor, search-and-replace that string to delete it, and your content should look beautiful-- no more extra, stubborn, line breaks.

January 2012

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 4.25