Double spaces

Freshness Warning
This blog post is over 19 years old. It's possible that the information you read below isn't current and the links no longer work.

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: http://radio.userland.com

*** 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.

Paul
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: http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3e825f083052ffff;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.

Paul
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.

Hal97
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

The Trap of The Sales-Led Product (Dec 10)
It’s not a winning way to build a product company.
The Hidden Cost of Custom Customer Features (Dec 7)
One-off features will cost you more than you think and make your customers unhappy.
Domain expertise in Product Management (Nov 16)
When you're hiring software product managers, hire for product management skills. Looking for domain experts will reduce the pool of people you can hire and might just be worse for your product.
Strategy Means Saying No (Oct 27)
An oft-overlooked aspect of strategy is to define what you are not doing. There are lots of adjacent problems you can attack. Strategy means defining which ones you will ignore.
Understanding vision, strategy, and execution (Oct 24)
Vision is what you're trying to do. Strategy is broad strokes on how you'll get there. Execution is the tasks you complete to complete the strategy.
How to advance your Product Market Fit KPI (Oct 21)
Finding the gaps in your product that will unlock the next round of growth.
Developer Relations as Developer Success (Oct 19)
Outreach, marketing, and developer evangelism are a part of Developer Relations. But the companies that are most successful with developers spend most of their time on something else.
Developer Experience Principle 6: Easy to Maintain (Oct 17)
Keeping your product Easy to Maintain will improve the lives of your team and your customers. It will help keep your docs up to date. Your SDKs and APIs will be released in sync. Your tooling and overall experience will shine.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2022 Adam Kalsey.