mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Merge pull request #1795 from braddunbar/trailing-space
Strip trailing space in fragments.
This commit is contained in:
@@ -989,7 +989,7 @@
|
||||
};
|
||||
|
||||
// Cached regex for cleaning leading hashes and slashes.
|
||||
var routeStripper = /^[#\/]/;
|
||||
var routeStripper = /^[#\/]|\s+$/;
|
||||
|
||||
// Cached regex for stripping leading and trailing slashes.
|
||||
var rootStripper = /^\/+|\/+$/g;
|
||||
|
||||
@@ -492,4 +492,9 @@ $(document).ready(function() {
|
||||
new Router;
|
||||
});
|
||||
|
||||
test("#1794 - Trailing space in fragments.", 1, function() {
|
||||
var history = new Backbone.History;
|
||||
strictEqual(history.getFragment('fragment '), 'fragment');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user