       tag = t.replace "#", ""
       "<a href='#!/topic/#{tag}' class='ttag'><span>#{tag}</span></a>"
 
-  expandUrls: (text) ->
-    return null unless text
-
-    # urlGrabber = ///
-    #   (\s|^)                              # Start after a whitespace or string[0]
-    #   ([a-zA-Z]+\://)?                    # Captures any protocol (just not //)
-    #   (\w+:\w+@)?                         # Username:Password
-    #   ([a-zA-Z\d-]|[a-zA-Z\d-]\.)*        # Subdomains
-    #   [a-zA-Z\d-]{2,}                     # Domain name
-    #   \.                                  # THE DOT
-    #   ([a-zA-Z]{2,4}(:\d+)?)              # Domain Extension with Port
-    #   ([/\?\#][\S/]*)*                    # Some Request, greedy capture
-    #   \b                                  # Last word boundary
-    #   /?                                 # Optional trailing Slash
-    # ///g
+  expandUrls: (text,replaceAndYieldLinks=no) ->
+    return null unless text
+
+    links = []
+    linkCount = 0
 
     urlGrabber = ///
     (?!\s)                                                      # leading spaces

        # url has no protocol
        url = '//'+url

      "<a href='#{url}' data-original-url='#{originalUrl}' target='_blank' >#{visibleUrl}#{if checkForPostSlash then "/…" else ""}<span class='expanded-link'></span></a>"

  putShowMore: (text, l = 500)->
    shortenedText = __utils.shortenText text,


  applyTextExpansions: (text, shorten)->
    return null unless text

    text = text.replace /&#10;/g, ' '
    text = @expandUsernames text

    # Expand URLs with intention to replace them after putShowMore
    {links,text} = @expandUrls text, yes

    text = __utils.putShowMore text if shorten

    # Reinsert URLs into text
    if links? then for link,i in links
      text = text.replace "[tempLink#{i}]", link

    return text
    # @expandWwwDotDomains @expandUrls @expandUsernames text

  expandWwwDotDomains: (text) ->
