1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Desktop: Resolves #1490: Add support for anchor hashes in note links

This commit is contained in:
Laurent Cozic
2019-09-09 18:16:00 +01:00
parent fa83107840
commit 7aea2cec69
11 changed files with 103 additions and 12 deletions

View File

@@ -39,4 +39,19 @@ urlUtils.prependBaseUrl = function(url, baseUrl) {
}
};
urlUtils.parseResourceUrl = function(url) {
const filename = url.split('/').pop();
const splitted = filename.split('#');
const output = {
itemId: '',
hash: '',
};
if (splitted.length) output.itemId = splitted[0];
if (splitted.length >= 2) output.hash = splitted[1];
return output;
};
module.exports = urlUtils;