     (link.href is location.href + '#')
 
 nonHtmlLink = (link) ->
-  link.href.match(/\.[a-z]+(\?.*)?$/g) and not link.href.match(/\.html?(\?.*)?$/g)
+  url = removeHash link
+  url.match(/\.[a-z]+(\?.*)?$/g) and not url.match(/\.html?(\?.*)?$/g)
 
 noTurbolink = (link) ->
   until ignore or link is document

  xhr.setRequestHeader 'X-XHR-Referer', referer

  xhr.onload = =>
    doc = createDocument xhr.responseText

    if assetsChanged doc
      document.location.reload()
    else
      changePage extractTitleAndBody(doc)...

  event.initEvent name, true, true
  document.dispatchEvent event


invalidContent = (xhr) ->
  !xhr.getResponseHeader('Content-Type').match /text\/html|application\/xhtml\+xml|application\/xml/

extractTrackAssets = (doc) ->
  (node.src || node.href) for node in doc.head.childNodes when node.getAttribute?('data-turbolinks-track')?
