jQuery(function($){
  $('a[href]').attr('href', function(){
    return $(this).attr('href').replace(/\.html?(#?\w*)$/, '$1');
  })
});
