     else
       n + ' ' + str + 's'
 
-  markdown: (s) ->
-    markdown.toHTML s
+  escapeURL: require('querystring').escape
+  markdown: require('markdown').toHTML
 
   gravatar: (p, s) ->
     "<img src=\"http://www.gravatar.com/avatar/#{p.emailHash}?s=#{s || 40}&d=monsterid\" />"

    throw e if e.errno != 2
    @next()

markdown = require 'markdown'
app.helpers {
  pluralize: (n, str) ->
    if n == 1

          redirectToLogin: ->
            @redirect "/login?return_to=#{@req.url}"
          logout: (fn) ->
            if @currentPerson?
              @currentPerson.logout (error, resp) =>
                @setCurrentPerson null
                fn()
            else fn()
          canEditTeam: (team) ->
            req.cookies.teamauthkey is team.authKey() or
              team.hasMember(@currentPerson) or
