     datetime:              rendered (text) ->
       new Date().format if text then text
     decode:                rendered (text) ->
-      decodeURIComponent text
+      if text then decodeURIComponent text
     depth:                 screen.colorDepth
     # Deprecated since 1.0.0, use `linkstarget` instead.
     doanchortarget:        -> @linkstarget
     # Deprecated since 1.0.0, use `linkstitle` instead.
     doanchortitle:         -> @linkstitle
     encode:                rendered (text) ->
-      encodeURIComponent text
+      if text then encodeURIComponent text
     # Deprecated since 0.1.0.2, use `encode` instead.
     encoded:               ->
       encodeURIComponent @url

    # Obsolete since 1.1.0, functionality has been removed.
    toolbarstyle:          no
    trim:                  rendered (text) ->
      text.trim()
    trimleft:              rendered (text) ->
      text.trimLeft()
    trimright:             rendered (text) ->
      text.trimRight()
    unescape:              rendered (text) ->
      _.unescape text
    uppercase:             rendered (text) ->
      text.toUpperCase()
    url:                   url.attr 'source'
    version:               ext.version
    wordcount:             rendered (text) ->
      # Oddly, this is the optimal method to calculate the word count on WebKit browsers.
      count   = 0
      text    = text.trim()

# Avoid repetitive calls to render the text contents of a Mustache section by passed `callback` the
# pre-rendered text and safely handling bad returns.
rendered = (callback) ->
  -> (text, render) ->
    result = if arguments.length then callback(render text) else do callback
    result ? ''

# Attempt to select a tab in the current window displaying a page whose location begins with
# `url`.  
