address failure to parse url when hash is not present

pull/1/head
ansuz 8 years ago
parent 6ae851ffdd
commit d512b113cd

@ -276,15 +276,15 @@ define([
};
var parsePadUrl = common.parsePadUrl = function (href) {
var patt = /^https*:\/\/([^\/]*)\/(.*?)\/#(.*)$/i;
var patt = /^https*:\/\/([^\/]*)\/(.*?)\//i;
var ret = {};
href.replace(patt, function (a, domain, type, hash) {
var hash = href.replace(patt, function (a, domain, type, hash) {
ret.domain = domain;
ret.type = type;
ret.hash = hash;
return '';
});
ret.hash = hash.replace(/#/g, '');
return ret;
};

Loading…
Cancel
Save