You've already forked joplin
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user