Remove left spaces when passing HTML to jQuery 1.9

Passing mustache generated HTML with left spaces to jQuery results in an error.
The proposed change implements a solution based on http://stage.jquery.com/upgrade-guide/1.9/#jquery-htmlstring-versus-jquery-selectorstring