Skip to content

Commit

Permalink
do not prepend ./ to relative paths - closes #76
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Apr 15, 2013
1 parent 5eb82e6 commit ed65056
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ URI.js is published under the [MIT license](http://www.opensource.org/licenses/m

## Changelog ##

* fixing [`relativeTo()`](http://medialize.github.com/URI.js/docs.htmlrelativeto) - ([Issue #75](https://github.com/medialize/URI.js/issues/75))
* fixing [`relativeTo()`](http://medialize.github.com/URI.js/docs.html#relativeto) - ([Issue #75](https://github.com/medialize/URI.js/issues/75))
* fixing [`normalizePath()`](http://medialize.github.com/URI.js/docs.html#normalize-path) to not prepend ./ to relative paths - ([Issue #76](https://github.com/medialize/URI.js/issues/76))

### 1.10.1 (April 2nd 2013) ###

Expand Down
6 changes: 1 addition & 5 deletions src/URI.js
Original file line number Diff line number Diff line change
Expand Up @@ -1518,11 +1518,7 @@ p.normalizePath = function(build) {
}
// revert to relative
if (_was_relative && this.is('relative')) {
if (_was_relative_prefix){
_path = _was_relative_prefix + _path;
} else {
_path = _path.substring(1);
}
_path = _path.substring(1);
}

_path = URI.recodePath(_path);
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ test("normalizePath", function() {
equal(u.path(), 'food/bar/baz.html', "relative parent");

u.path('./food/woo/../bar/baz.html').normalizePath();
equal(u.path(), './food/bar/baz.html', "dot-relative parent");
equal(u.path(), 'food/bar/baz.html', "dot-relative parent");

// absolute URL
u = new URI('http://example.org/foo/bar/baz.html');
Expand Down

0 comments on commit ed65056

Please sign in to comment.