diff --git a/backbone.js b/backbone.js index b5bfe01e..bec4de00 100644 --- a/backbone.js +++ b/backbone.js @@ -730,7 +730,7 @@ }; // Cached regex for cleaning hashes. - var hashStrip = /^#*/; + var hashStrip = /^#*!?/; // Cached regex for detecting MSIE. var isExplorer = /msie [\w.]+/; diff --git a/test/controller.js b/test/controller.js index 1ad3c6c6..2c02953a 100644 --- a/test/controller.js +++ b/test/controller.js @@ -106,4 +106,13 @@ $(document).ready(function() { }, 10); }); + asyncTest("Controller: routes (hashbang)", 2, function() { + window.location.hash = '!search/news'; + setTimeout(function() { + equals(controller.query, 'news'); + equals(controller.page, undefined); + start(); + }, 10); + }); + });