address failure to parse url when hash is not present

pull/1/head
ansuz 2016-11-02 18:28:19 +01:00
parent 6ae851ffdd
commit d512b113cd
1 changed files with 3 additions and 3 deletions

View File

@ -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;
};