     ,
       type: 'html'
       regex: '</li>'
-      replace: ''
+      replace: '\n'
     ]
 
-  render = new Showdown.converter extensions: [mv]
-  mvcode = new Showdown.converter extensions: [bbcode]
+  render = new Showdown.converter extensions: [noWhite, noPre, mv, noP('<br><br>')]
+  mvcode = new Showdown.converter extensions: [noWhite, noPre, bbcode, noP('\n\n')]
 
   generated = document.getElementById 'code'
 

      replace: '<$1$2>'
    ,
      type: 'html'
      regex: '\n'
      replace: '<br/>'
    ,
      type: 'html'
      regex: '</?pre>'
      replace: ''
    ,
      type: 'html'
      regex: '</?p>'
      replace: ''
    ,
      type: 'html'
      regex: '<ul>'
      replace: '<ul class="flist">'
    ,
      type: 'html'
      regex: '<ol>'
      replace: '<ul class="flist">'

window.onload = ->

  code = (converter) ->
    [
      type: ''
    ]

  noWhite = (converter) ->
    [
      type: 'html'
      regex: '\n'
      replace: ''
    ]

  noP = (replace) -> (converter) ->
    [
      type: 'html'
      regex: '<p>'
      replace: ''
    ,
      type: 'html'
      regex: '</p>'
      replace: replace
    ]

  noPre = (converter) ->
    [
      type: 'html'
      regex: '</?pre>'
      replace: ''
    ]


  mv = (converter) ->
    [ # #
      type: 'html'
      regex: '<h1.*>(.*)</h1>'
      replace: '<h4 class="bar"><span>$1</span></h4><br><br>'
    , # ##
      type: 'html'
      regex: '<h2.*>(.*)</h2>'
      replace: (match, content, num, text) ->
        "<img src=\"http://tools.mediavida.com/sub.php?t=#{encodeURIComponent content}\"><br><br>"
    , # code
      type: 'html'
      regex: '<code>'
      replace: '<code class="prettyprint linenums">'
