Skip to content
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

Consider correctly absolute url with // #47

Merged
merged 2 commits into from Mar 30, 2014

Conversation

Uelb
Copy link
Contributor

@Uelb Uelb commented Mar 19, 2014

This commit fixes #46

@@ -36,6 +36,8 @@ window._pjs = (function($) {
function toFullUrl(url) {
// non-existent, or fully qualified already
if (!url || url.indexOf(base) === 0 || !isLocalUrl(url)) return url;
// absolute url beginning with // (same protocol as the current location)
if(url[0] == '/' && url[1] == '/') return loc.protocol + url;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good addition, but an odd implementation - maybe just

if (url.indexOf('//') === 0) return loc.protocol + url;

@Uelb
Copy link
Contributor Author

Uelb commented Mar 30, 2014

I updated the implementation :)

@nrabinowitz
Copy link
Owner

Thanks! Merging.

nrabinowitz pushed a commit that referenced this pull request Mar 30, 2014
Consider correctly absolute url with //
@nrabinowitz nrabinowitz merged commit 881cb7c into nrabinowitz:master Mar 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getAnchorUrls does not work on href="//foo.com" links
2 participants