           href = @props.href = href.replace('//', '/')
 
 
-
       handle_click = (event) =>
         opened_in_new_tab = event.altKey  || \
                             event.ctrlKey || \

onload = -> 

  Earl.root = get_script_attr('earl', 'root') or '/'
  if window.location.pathname.match('.html')
    Earl.root += location.pathname.match(/\/([\w-_]+\.html)/)[1] + '/'
  if Earl.root[0] != '/'

  loc = fetch 'location'

  url = loc.path or '/'
  if loc.query_params && Object.keys(loc.query_params).length > 0
    query_params = ("#{k}=#{v}" for own k,v of loc.query_params)
    url += "?#{query_params.join('&')}" 
