IntelliJ IDEA 14: How to stop stripping of trailing spaces

I’ve recently been using Markdown in conjunction with Metalsmith to create some new static content web sites (more on this in a future post). IntelliJ IDEA, IMHO the world’s best IDE for Java/web/Python/PHP (and many more languages/technologies) supports all the popular web technologies and is a joy to use most of the time.

However, I came across an annoying little problem recently when I noticed that line breaks were missing from my Markdown generated content. Markdown uses 2 trailing spaces on a line to signify that a line break is required, and it transpired that IDEA was stripping these trailing spaces from lines when the Markdown file was saved!

After a bit of a search through the IDEA Editor settings I finally found the offending option buried deep in the Editor / General section:


The default setting is set to strip trailing spaces so simply select “None” here and your Markdown line breaks will remain intact!

A month of using my MacBook Pro

It’s been over a month since I got my new MacBook Pro so I thought I’d post a few thoughts on my experience with it so far.

First, I’ve got to say I love it!

It exudes quality in nearly every area.

On the hardware side, the things I love most are:

  • the aluminium unibody construction is rock solid, yet still light
  • the quad core Intel Core i7 processor, 16GB RAM and 512GB flash storage make it fly!
  • the Retina 15″ screen is very high quality and provides plenty of screen real estate to work with. I was concerned about dropping down from a 17″ screen to 15″ but that’s not proved to be a problem at all
  • the trackpad is the best I’ve ever used… very accurate and responsive and when combined with multi-touch gestures takes it to another level
  • battery life has been very good so far (I get home from my 4 hour commute to London and back with around 80% battery left which is fantastic compared with the 20% remaining I used to get from my old HP laptop!)
  • the sleep and instant-on behaviour when closing and opening the lid is great
  • the Magsafe 2 power connector is so quick and easy to connect with its magnetic connection and useful indicator LED showing charging state

On the OS / software side I’ve found working with OS X on a daily, development-oriented basis quite refreshing. The multiple Spaces (desktops) works very well and intuitively with multi-finger trackpad swipes to switch between them. I’m also using the Mission Control (formerly Exposé) feature a lot to see a birds eye view of all applications I have open, and the App Exposé feature to see all windows opened by the current application.

The recent Mac OS X 10.10 Yosemite upgrade looks really nice and makes it even more pleasant to use.

When I’m travelling, I rely on the mobile network connection from my Nexus 5 phone for internet access. With my old Windows laptop I used to use a wifi hotspot on the phone to connect, but on the MacBook I’m using the Bluetooth connection which seems easier and very stable.

The only minor problem I’ve had is that the Moshi iGlaze transparent hard case I fitted for some extra protection started to crack in the corners of the lid cover. This happened just over a month after getting it but Amazon replaced it free of charge when I reported the problem to them. It is a nice case and definitely adds  some valuable protection without detracting from it’s appearance – in fact most people don’t even realise there’s a case on it! – but I think the cracking is a basic design flaw so I’m expecting it to happen again 🙁



Enabling HTML tag formatting in Drupal WYSIWYG / TinyMCE

I use Drupal for many of my more complex web sites – it’s an excellent Content Management System. I also regularly use the TinyMCE WYSIWYG editor to provide rich text editing capability when editing content.

Recently I noticed that I was no longer able to format sections of text using HTML levels such as paragraph, heading1, heading2 etc. I’m sure this was present in previous versions but seemed to have disappeared in later versions. Sure, I could open up the raw HTML source editor for the content and add the appropriate tags there, but that defeats the object of having a WYSIWYG editor.

After searching for a solution and looking into various plugins which reportedly added this functionality, I came across the simplest solution that was there all along… there is an “HTML block format” check box in the TinyMCE toolbar button configuration that I’d missed!

When this is enabled, a new combo box is added to the TinyMCE toolbar allowing “Paragraph”, “Heading 2”, “Preformatted” etc. formatting styles to be selected.

PHP 5.3.3 and MySQL 5.1.44 problems on Windows 7

I’ve only recently returned to PHP and MySQL development on my new(ish) Windows 7 64-bit laptop after having done mostly Java development and static HTML sites over the last few months. Having gone through the development environment setup for Apache / PHP / MySQL etc. a million times before I just went through the motions and installed the latest versions of each component – namely Apache 2.2.16, PHP 5.3.3 and MySQL 5.1.44 at the time of writing. Assuming everything would just work as expected, I dived into development, but quickly noticed things weren’t quite right…

The first problem I encountered was with the guided setup for a new Drupal 7 alpha installation. As soon as it got to the MySQL database configuration step, it seemed to fail with a blank web page. No errors or hints as to what was wrong. Then I noticed a similar problem trying to login to a new PHPMyAdmin install. I double checked all the configuration files, re-installed both PHP and MySQL, but the problem was still happening.

At this point I did some Googling and found a post stating that it was a problem with an authentication incompatibility between PHP 5.3 and MySQL 5 and recommended rolling back to PHP 5.2.14. I tried this as suggested and both Drupal and PHPMyAdmin sprung back to life. So I’m sticking with PHP 5.2.14 for the time being…

[UPDATE] I’ve since done a bit more Googling and found this post which suggests it could in fact be an IPv6 related issue. I’ll do some more investigation when I get time.

My latest web development – Early Birds Nursery

Every now and again I create the occasional web site for family, friends, local organisations or businesses. I enjoy doing them (quite often for free!) as it’s another opportunity to flex my creative and technical muscles at the same time and also to help out people or organisations who don’t necessarily want to (or simply can’t) spend a fortune on web development.

I’m just finishing off a simple web site for a local pre-school nursery, called Early Birds Nursery (

For this site I’ve tried to come up with a colourful, fun and almost child-like visual style using bold, primary colours and cartoon style graphics.  I don’t know what you think, but I’m pretty pleased with the result.