Update to latest jsonld.js.
--- a/playground/jsonld.js Fri May 03 10:56:29 2013 -0400
+++ b/playground/jsonld.js Fri May 03 11:15:44 2013 -0400
@@ -4682,8 +4682,9 @@
// use '../' for each non-matching base segment
var rval = '';
if(baseSegments.length > 0) {
- // do not count the last segment if it isn't a path (doesn't end in '/')
- if(base.normalizedPath.substr(-1) !== '/') {
+ // don't count the last segment if it isn't a path (doesn't end in '/')
+ // don't count empty first segment, it means base began with '/'
+ if(base.normalizedPath.substr(-1) !== '/' || baseSegments[0] === '') {
baseSegments.pop();
}
for(var i = 0; i < baseSegments.length; ++i) {