       # failing that prefer to end the teaser at the end of a word (a space).
       candidate = tryToShorten(longText, '. ', suffix) or tryToShorten longText, ' ', suffix
 
-      if candidate?.length > minLength
-        Encoder.htmlEncode candidate
-        # candidate
-      else
-        Encoder.htmlEncode longText
-        # longText
+      Encoder.htmlEncode \
+        if candidate?.length > minLength then candidate
+        else longText
 
   getMonthOptions : ()->
     ((if i > 9 then { title : "#{i}", value : i} else { title : "0#{i}", value : i}) for i in [1..12])

      suffix    = options.suffix     ? '...'

      longTextLength  = Encoder.htmlDecode(longText).length
      # longTextLength  = longText.length

      return longText if longTextLength < minLength or longTextLength < maxLength


    parentPath.pop()
    return parentPath.join('/')

  removeBrokenSymlinksUnder:(path)->
    kiteController = KD.getSingleton('kiteController')
    escapeFilePath = FSHelper.escapeFilePath
    kiteController.run "stat #{escapeFilePath path}", (err)->
      if not err
        kiteController.run "find -L #{escapeFilePath path} -type l -delete", noop

  wait: (duration, fn) ->
    if "function" is typeof duration
      fn = duration
      duration = 0
    setTimeout fn, duration

  defer:do ->
    # this was ported from browserify's implementation of "process.nextTick"
    queue = []
