code: function(s, preserve_entities) {
        if (preserve_entities) {
        return s.replace(/[&](?![#](x[a-f0-9]{1,8}|[0-9]{1,8});|[a-z][a-z0-9]{1,31};)/gi,'&amp;')
                .replace(/[<]/g,'&lt;')
                .replace(/[>]/g,'&gt;')
                .replace(/["]/g,'&quot;');
        } else {
        return s.replace(/[&]/g,'&amp;')
                .replace(/[<]/g,'&lt;')
                .replace(/[>]/g,'&gt;')
                .replace(/["]/g,'&quot;');
        }
      }
docs: by default, soft breaks are rendered as newlines in HTML set to "<br />" to make them hard breaks set to " " if you want to ignore line wrapping in source