Spaces inserted into HTML by Campaign Monitor

Yes, I know: spaces in HTML code shouldn't have any effect on layout.... but unfortunately, they do when it comes to typography.

When I use the CM template editor to create a newsletter, writing the following piece of code into the editor and setting the link via the built-in tools, a space is generated after the closing </a> tag.

This is a piece of text containing a <a href="#">link</a>, which should be implemented 1:1.

If the word "link" and the comma are at the end of a line and are separated by a space, the comma drops to the following line through regular browser line wrapping. If there is no space, the conjoined "link," is correctly viewed as one unit, and both word and comma drop to the following line. (Desired behaviour.)

So, please don't add spaces to the text articifically! It buggers up my layout and means that for a pedantic client – or indeed one for whom grammar is important – I can't use the template system.

bm-crossmedia bm-crossmedia, 8 years ago

Interestingly, this issue first appears at the /csend/editor-preview.aspx stage, not at the editor stage.

Mathew Mathew, 8 years ago

Campaign Monitor won't add a space normally - it is only when we break your HTML onto a new line, which is actually done to work around some other email client rendering problems.

This is one of those situations where both methods have issues unfortunately. You might be able to work around it by keeping your template source code in shorter lines in many cases.

Get in touch with us on Twitter:
We're also on Facebook:
Aaron Wallentine, 8 years ago

I'm observing that whenever I paste any text into the editor, it's converting all the spaces to nbsp's (&nbsp;) -- this is a problem because it messes up wrapping.  If I have a long line of plain text, I'm expecting it to wrap naturally depending on the width of the container.  But since the editor is converting all pasted spaces to nbsp's, it's not wrapping and it's causing the container to stretch horizontally to accommodate.

Now if I just type the same text into the editor, it behaves as expected - keeping my regular spaces, etc.

I don't know if the browser I'm using the editor in has an effect, for the record I've tried Chrome and Firefox.

Any help?  Am I doing something wrong here?

I'm afraid my clients are going to paste in their articles, and they will stretch and mess up the template I'm creating for them.

Aaron Wallentine, 8 years ago

OK I've been messing with this for a while and I've gotten a little more insight.  It's some sort of encoding issue.

I had copied the text from a pdf file, using an alternative PDF viewer that I've come to enjoy on Windows called "PDF-XChange Viewer" ... when copying the text from PDFXChange and pasting somewhere else, even my plain text editor, the spaces appeared to be normal.  But then I noticed it was wrapping funny even in MS Word.  So I opened it up in Hex-editing mode in my text editor, and noticed that the spaces when I pasted it out of that program where coming through as 0xa0 (194) instead of a regular space, 0x20 (32).

So I tried the same text out of Adobe Reader (8) and it worked fine, spaces were 0x20 like they should be.

Problem solved.  Sorry for the false alarm. Hopefully this may help someone else if they have a similar frustration.

So even though they looked like regular spaces, they weren't, and that's why Campaign Monitor was converting them to nbsp upon paste.

For what it's worth, PDF-XChange Viewer allows me to highlight some text and get "Properties", which shows me that all the letters of this text were in "WinAnsiEncoding", but the spaces between them were encoded as "Identity-H".  Adobe Reader 8, under File->Properties, also shows that the document contains text encoded in "Identity-H" - whatever the heck that is.

See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free