-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traditional urls getting rewritten if period (.) is in the hash #316
Comments
I have similar problems in #315. |
I created a pull request to fix this. #322 |
Any reason why dot is still used as separator? According to http://tools.ietf.org/html/rfc3986 dot is valid character for fragment. This causes rewrite of hash with dot into path, ie:
Becomes
Had hard time figuring out why this happens. |
There is a workaround for this issue. After including history.js, delay init, alter History.options.delayInit = true;
History.isTraditionalAnchor = function(url_or_hash) {
var isTraditional;
isTraditional = !(/[\/\?]/.test(url_or_hash));
return isTraditional;
};
History.init(); |
@pmaselkowski thanks - and your comment just in time for when I started looking at this issue! |
I had to alter the regexp this way : [?] otherwyse, the / is alos forbidden in the hash part |
@pmaselkowski I did add your script and the value of the isTraditional is false but the url is not updated. url was loungewear/icat/unisex-loungewear# size = XS After changing size to size = X/S it becomes loungewear/icat/size=XL/2X |
@kiflay see brunob2f comment, maybe You need to tweak with regexp. |
Thanks @pmaselkowski |
We are using history 1.7.1. We have cases where a period is part of the a hash parameter value. In onPopState in History.js it calls replaceState because it says it found a state. This causes a rewrite of the url from:
http://localhost:5000/search/record/results#count=20&query=%2Bgivenname%3Apatrick~%20%2Bsurname%3Ajones.~
to
http://localhost:5000/search/record/count=20&query=+givenname:patrick~%20+surname:jones.~
All because it is thinks it is a traditional url. Here is the function:
Why isTraditionalAnchor looking for a period? I don't understand how a tradition anchor is determined by a / . or ?
At any rate, it appears to be a bug unless I am not understanding this. It is not fixed in 1.8.0 either.
The text was updated successfully, but these errors were encountered: