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

Desktop, Mobile: Fixes #1870: Support non-alphabetical characters in note link anchors

This commit is contained in:
Laurent Cozic
2019-09-12 21:57:23 +01:00
parent 5db7502fe4
commit 0379523eaf
6 changed files with 38 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
const { rtrimSlashes } = require('lib/path-utils');
const { urlDecode } = require('lib/string-utils');
const urlUtils = {};
@@ -55,7 +56,11 @@ urlUtils.parseResourceUrl = function(url) {
};
if (splitted.length) output.itemId = splitted[0];
if (splitted.length >= 2) output.hash = splitted[1];
// In general we want the hash to be decoded so that non-alphabetical languages
// appear as-is without being encoded with %.
// Fixes https://github.com/laurent22/joplin/issues/1870
if (splitted.length >= 2) output.hash = urlDecode(splitted[1]);
return output;
};