     if @settings.routeLinks
       $(document).off 'click', @settings.routeLinks
 
+  isExternalLink: (link) ->
+    link.target is '_blank' or
+    link.rel is 'external' or
+    link.protocol not in ['http:', 'https:', 'file:'] or
+    link.hostname not in [location.hostname, '']
+
   # Handle all clicks on A elements and try to route them internally.
   openLink: (event) =>
     return if utils.modifierKeyPressed(event)

      type is 'string' and $el.is skipRouting

    # Handle external links.
    internal = not isAnchor or el.hostname in [location.hostname, '']
    unless internal
      if @settings.openExternalToBlank
        # Open external links normally in a new tab.

      # Exclude fragment links.
      href.charAt(0) is '#'

    # Apply skipRouting option.
    skipRouting = @settings.skipRouting
    type = typeof skipRouting
