Need someone to lead product or development at your software company? I lead product and engineering teams and I'm looking for my next opportunity. Check out my resume and get in touch.

Double spaces

Freshness Warning
This article is over 17 years old. It's possible that the information you read below isn't current.

Sounds like a challenge.

Okay, I’ll bite. Download Doublespace, a Movable Type plugin for converting multiple spaces to non-breaking spaces so they’ll display properly in HTML. No real documentation for this one. Just put it in your plugins directory and add double_spaces="1" to your MT tags.

Tim Appnel has taken over the maintenance and support of this plugin as of Oct 2004.

Adam Kalsey
October 14, 2002 10:15 PM

There was an error in my thinking on this plugin. If an entry had two or more consecutive spaces, all spaces in the entry would be replaced by non-breaking spaces. I've now fixed it so that all instances of two spaces will be replaced by a space followed by a non-breaking space. That should work all the time without inserting unnecessary non-breaking spaces.

Dog Newsie
October 18, 2002 7:26 AM

and the same can be said for Radioland's fabulous Radioland blogging software. In fact, often I have a wish for a feature and before I can even voice my desire, it's implemented. Fixes and new features are release almost every day. Bugs do exist (the ever present paragraph bug), but they are ones that are difficult to fix and we have to be patient, because it takes time to fix them (how much griping would you tolerate if you sold a tool like this for $39. These people are amazingly tolerant of us newbies.) Amazingly, they just keep improving it anyway. Radioland:

*** Dave
October 23, 2002 3:22 PM

Tres cool -- except that a double-space created by the plug-in can be can be broken across lines, so that you can have a spurious space show up on the next line. Not sure how you'd get around that, but it was a nice try.

Adam Kalsey
October 23, 2002 4:03 PM

Well, yes, but that's a limitation of HTML. Multiple instances of whitespace are condensed down to a single instance when the code is rendered. The only way to have two or more spaces in a row is to use a non-breaking space. Add to that the fact that there's no real way to specify the line length (or even to figure out where on the line a character is), and you can see the problem isn't really solvable. If you want perfect control over your typography, you shouldn't be using HTML. Try PDF instead. By the way, I disagree with the two spaces thing. There should be a single space after a period. Period. I just built the plugin because Scott asked.

March 26, 2003 9:04 PM

Hey there. I was wondering if this plugin can be modified to give me a double return when only one is hit. I am trying to accomplish a first line indent for each paragraph in my entries, but the text that I am posting is all completed with just one carriage return, so MT does nothing with it. Here is my thread on MT's forum:;act=ST;f=14;t=17277 Thanks in advance for any input you can give.

Adam Kalsey
March 27, 2003 11:19 AM

Plugins only work with the data that comes out of MT. There's no way for them to affect the data going into it. If all you want is for 5 spaces to follow every <br> tag, you could modify Double Spaces to do that for you. Just change the line that reads: $string =~ s| | &nbsp;|g; to read $string =~ s|(<br\s+?/?>)|$1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|g; The HTML it generates isn't going to win any awards for semantic markup, but it will display correctly in the browser.

March 28, 2003 10:03 AM

Hey adam. Thanks a bunch for that. I edited it, and changed the name to DoubleReturn, and left all your information intact. It works just like I wanted it to. Much thanks again!

Trackback from Law Student's Journal
April 7, 2003 2:46 AM

It's not just me!

Excerpt: Seems I'm not the only one griping about not having double spaces between sentences. Thank god someone did something about it... I'm giving it a test run....

Trackback from the golden path
April 23, 2003 8:45 PM

About the site

Excerpt: Philiosophy As a discourse between myself and the wider world, the golden path is an unorganized accumulation of hopes, the embodiment of wish. Design notes can be found in the archives of this site itself, but include: February 12, 2003...

A visitor
August 8, 2003 9:32 AM

The way to fix what Dave is talking about is to have the two spaces converted to a nonbreaking space followed by a regular space. Currently you have them reversed, it seems.

Brad Carps
November 12, 2003 10:12 AM

Adam, I thank you for making such a useful MT plugin. However, I'd like to suggest that you format your double spaces with "&nbsp; " instead of " &nbsp;" because the latter syntax you use seems to put an occasional extra space at the front of some wrapped lines in certain paragraphs. Namely, if a sentence ends right where the line wraps, then the non-breaking space gets added to the following line. I've found that for left-aligned text, if you put the non-breaking space right next to the word, most browsers interpret it as part of the word and as a result, won't add it to the beginning of the next line. $string =~ s|  |&nbsp; |g; Thanks again for the script.

December 7, 2003 2:13 AM

What Brad there says is quite useful for left aligned text as he says... however would be problematic for right aligned (it'd end up with basically the same problem we have now, but the superfluous space would be at the end of a sentance). So hows about an attribute saying you want it formatted for right aligned text (with left aligned being default).

This discussion has been closed.

Recently Written

A framework for onboarding new employees (May 15)
There’s no single good way to onboard an employee that works for every role. Here's a framework for creating a process that you can adapt to each situation.
TV hosts as a guide for software managers (May 10)
Software managers can learn a lot from journalists or late night TV hosts and how they interview people.
The Improvement Flywheel (Apr 29)
An incredible flywheel for the improvement of a development team. Fix a few things, and everything starts getting better.
Managers and technical ability (Dec 26)
In technical fields, the closer you are to the actual work being done, the closer your skills need to resemble those of the people doing the work.
Dysfunctions of output-oriented software teams (Sep 17)
Whatever you call it, the symptom is that you're measuring your progress by how much you build and deliver instead of measuring success by the amount of customer value you create.
Evaluative and generative product development (Aug 30)
Customers never even talk to the companies that don't fit their needs at all. If the only product ideas you're considering are those that meet the needs of your current customers, then you're only going to find new customers that look exactly like your current customers.
Product Manager Career Ladder (Aug 19)
What are the steps along the product management career path?
Building the Customer-Informed Product (Aug 15)
Strong products aren't composed of a list of features dictated by customers. They are guided by strong visions, and the execution of that vision is the primary focus of product development.


What I'm Reading


Adam Kalsey

+1 916 600 2497


Public Key

© 1999-2020 Adam Kalsey.