-
Notifications
You must be signed in to change notification settings - Fork 0
Fixed description link paths #357
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
Conversation
|
@chasenlehara my bad! I clearly didn't test that good enough. Updated the PR 😄 |
static/search.js
Outdated
| var a = $a[0]; | ||
| var isLocal = a.hostname === location.hostname; | ||
| var isRelative = a.getAttribute('href').indexOf(location.hostname) === -1; | ||
| if(a.hostname !== location.hostname || a.protocol !== location.protocol){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a.hostname !== location.hostname could be !isLocal
| $a.attr('target', '_blank'); | ||
| } | ||
| if(isLocal && isRelative){ | ||
| var prefix = parentHref.substr(0, parentHref.lastIndexOf('/')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on lines like this would make the code easier to read.
|
|
||
| if(this.url.substr(-1) === "/"){ | ||
| if(url.substr(-1) === "/"){ | ||
| return this.url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be just url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static/search.js
Outdated
| var $html = $('<div>').html(html); | ||
| $html.find('a').each(function(){ | ||
| var $a = $(this); | ||
| var a = $a[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through this dance to convert the object to be jQuery-wrapped and then to unwrap it seems odd.

No description provided.