{"id":757,"date":"2015-11-27T09:37:57","date_gmt":"2015-11-27T13:37:57","guid":{"rendered":"http:\/\/tech.creed3.com\/?p=757"},"modified":"2015-11-27T12:12:24","modified_gmt":"2015-11-27T16:12:24","slug":"the-case-of-the-missing-space","status":"publish","type":"post","link":"https:\/\/tech.creed3.com\/?p=757","title":{"rendered":"The Case of The Missing Space"},"content":{"rendered":"<p><img decoding=\"async\" style=\"margin: 0 4px 4px 0;\" alt=\"\" src=\"images\/stories\/wordpress-logo-simplified-rgb.png\" width=\"100\" align=\"right\" border=\"0\" \/>In the current trend of publishing, both online and in print, you may or may not have noticed the practice of placing 2 spaces between two sentences has been abandoned. &nbsp;Today only one space is used. &nbsp;Is this laziness or truly a case of where it&#8217;s no longer needed?<!--more--><\/p>\n<p>Do a quick search online for double space and you&#8217;ll find tales of two spaces being used between sentences originating due to typewriters not having good font spacing, or kerning. &nbsp;You&#8217;ll also find a great deal of complaining about the &#8216;unnecessary&#8217; extra space between sentences in older texts being converted for online use. &nbsp;It&#8217;s almost reached a level of extreme hatred. &nbsp;I can only shake my head in wonderment at the things people get high blood pressure over these days. &nbsp;But I digress.<\/p>\n<p><strong>&#8216;Back in the old days when I was kid&#8230;&#8217;<\/strong><br \/>\nIn all seriousness, everything I read as a youth had this double space separating sentences. &nbsp;Books, mimeographs (that&#8217;s the precursor to photocopies for you youngsters), newspapers. &nbsp;I think people even tended to hand write letters that way. &nbsp;Frankly, having the sentences spaced out a bit makes reading a much easier task. &nbsp;It adds a nice open feel which seems to somehow make the document breathe. &nbsp;I much prefer it, to the point of finding documents without the extra space very tedious to read. &nbsp;So why has this practice been almost completely abandoned?<\/p>\n<p>With the advent of the internet and web sites came the screen rendering language of HTML, which is still the underlying rendering code in web sites today. &nbsp;For what ever reason those brilliant guys that created HTML made it so that any space character more than one was ignored. &nbsp;Type 12 spaces and it shows up as a single space on a web page. &nbsp;Why? &nbsp;I have no idea. &nbsp;But it sure made fine tuning the spacing of things a little difficult at first. &nbsp;After a time they built in a special character you could use in your HTML that would force the display of as many spaces as you desired. &nbsp;Obviously being able to have multiple spaces together was missed. &nbsp;The only caveat is you have to know what that special HTML character is in order to use it. &nbsp;You can&#8217;t simply press the space bar and get it. &nbsp;Today, the rules are still the same. &nbsp;HTML still ignores all spaces after the first one without using the special character. &nbsp;There are a range of positioning options today especially with CSS that have greatly enhanced the visual layout of sites and so the lowly space character has become far less important than ever.<\/p>\n<p><strong>The Missing Space<\/strong><br \/>\nI&#8217;m not an editor or proofreader or English major. &nbsp;I&#8217;m sure anyone in these professions might be able to elucidate the reasoning behind dropping the extra space. &nbsp;My own guess is as our culture transitioned from print to online it was too much trouble to retain that extra space that HTML ignores. &nbsp;Call it laziness, or maybe not realizing there is a way to have it there, or perhaps people were tired of fighting the HTML limitation on this. &nbsp;No matter the reason, we simply adapted to it not being there. &nbsp;And today people believe and argue it shouldn&#8217;t be there.<\/p>\n<p>Well&#8230; I miss it and want it.<\/p>\n<p>Apparently I&#8217;m not alone because there&#8217;s a solution for it for WordPress. &nbsp;A nifty plugin called <a href=\"https:\/\/wordpress.org\/plugins\/extra-sentence-space\/\" target=\"_blank\">Extra Sentence Space<\/a> by Scott Reilly. &nbsp;The description reads simply: &#8216;Force browsers to display two spaces (when present) between sentences.&#8217;, and it works beautifully. &nbsp;Thank you Scott! &nbsp;It&#8217;s super easy for anyone to install and all you need do is activate it. &nbsp;It simply works.<\/p>\n<p><strong>Another Option<\/strong><br \/>\nNot to dismiss Scott&#8217;s brilliant plugin but I have another solution to this quandary. &nbsp;What brought me to this concept was time developing my own plugins as well as custom themes for various WordPress installations.<\/p>\n<p>Recently I decided I needed to optimize a few sites and coax WordPress into loading a bit quicker. &nbsp;By it&#8217;s very nature WordPress isn&#8217;t prone to quick loading. &nbsp;Let&#8217;s face it, no heavy coded, database driven site could ever reach the load time of a plain, static HTML site. &nbsp;However it doesn&#8217;t do too bad. &nbsp;That is unless you have a lot of plugins installed or a really heavy theme with large graphics and it&#8217;s own programmatic hoops to jump through. &nbsp;I loathe heavy sites. &nbsp;Especially sites with mountains of code that serve no purpose other than enabling lazy developers. &nbsp;But that&#8217;s another post for another day.<\/p>\n<p>Admittedly I had been lax in optimizing a few WordPress installations for load time, so now was the time. &nbsp;In reviewing things I was able to reduce graphic file sizes and code clutter in themes which helped. &nbsp;I then turned to plugins to see if there were any I could eliminate. &nbsp;Plugins can be a heavy burden on a WordPress site, each one causing extra processing time and adding to the load time.<\/p>\n<p>In my review I considered <a href=\"https:\/\/wordpress.org\/plugins\/extra-sentence-space\/\" target=\"_blank\">Extra Sentence Space<\/a>. &nbsp;There was no doubt I wanted that extra space. &nbsp;But my forays in to theme building have taught me that often times there is a simple solution to a formatting issue by using a quick theme function. &nbsp;Correctly displaying double spaces is a formatting issue. &nbsp;You might ask, isn&#8217;t adding a function to your theme adding more processing that adds to the load time? &nbsp;Well yes, in fact it does. &nbsp;However if a simple function could do the same task as a plugin it&#8217;s far less overhead on the WordPress system. &nbsp;And in this case, there is a solution.<\/p>\n<p>For those of you who are familiar with theme functions and desire that extra space, add this to your theme function.php file:<\/p>\n<pre><code>function c3_display_dbl_spaces($content){\r\n\treturn preg_replace(\"\/(.|\\?|!)( {2})\/\", \"\\\\1 &amp;nbsp;\", $content);\r\n}\r\nadd_filter( 'the_content', 'c3_display_dbl_spaces', 20 );<\/code><\/pre>\n<p>It&#8217;s a simple regular expression to find every instance of double spaces after a period, exclamation mark, or question mark in a post as it&#8217;s calling it from the database. &nbsp;It replaces those two spaces with one space followed by the HTML special character for a space, and then sends it to the browser. &nbsp;It doesn&#8217;t edit the database, only changes it as it&#8217;s being called by the browser. &nbsp;NOTE: there is a space in front of the {2}. &nbsp;At first I used \\s instead but ran into trouble in some posts when tabs and new lines were converted to double spaces. &nbsp;The last line after the function tells WordPress to apply the function to the content in the post and assigns a lower importance to it (20) so any other functions that need to run go first.<\/p>\n<p>I Hope one of these options helps you get your missing space back!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the current trend of publishing, both online and in print, you may or may not have noticed the practice of placing 2 spaces between two sentences has been abandoned. &nbsp;Today only one space is used. &nbsp;Is this laziness or truly a case of where it&#8217;s no longer needed?<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,16,30,41],"tags":[],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-online","category-technology","category-web-development","category-wordpress"],"views":25352,"_links":{"self":[{"href":"https:\/\/tech.creed3.com\/index.php?rest_route=\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tech.creed3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.creed3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.creed3.com\/index.php?rest_route=\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.creed3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=757"}],"version-history":[{"count":0,"href":"https:\/\/tech.creed3.com\/index.php?rest_route=\/wp\/v2\/posts\/757\/revisions"}],"wp:attachment":[{"href":"https:\/\/tech.creed3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.creed3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.creed3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}