/**
 * Module dependencies. 
 */
var showdown = require('showdown');
var marked   = require('marked');
var R        = require('./global');

marked.setOptions({
  renderer:    new marked.Renderer(),
  gfm:         true,
  tables:      true,
  breaks:      false,
  pedantic:    false,
  sanitize:    true,
  smartLists:  true,
  smartypants: false
});

// Initialize a showdown coventer. 
var converter = showdown.converter 
  ? new showdown.converter()
  : new showdown.Converter();

/**
 * Markdown parser with showdown.
 *
 * @param {String} input
 * @api public
 */

exports.parse = function(input) {

    var useMarked =  R.get("marked");

    if ( useMarked == "true" ) {
        return marked(input);
    } else {
        return converter.makeHtml(input);
    }
};


@@ -598,18 +598,16 @@
 put) %7B%0A%0A
-  
   var us
@@ -635,18 +635,16 @@
 ked%22);%0A%0A
-  
   if ( u
@@ -666,20 +666,16 @@
 ue%22 ) %7B%0A
-    
     retu
@@ -692,18 +692,16 @@
 input);%0A
-  
   %7D else
@@ -703,20 +703,16 @@
  else %7B%0A
-    
     retu
@@ -741,18 +741,16 @@
 input);%0A
-  
   %7D%0A%7D;%0A%0A

normalize indentations