prefer wtvshared.escape over encodeURIComponent

This commit is contained in:
zefie
2025-08-14 18:57:37 -04:00
parent 54b960a840
commit e7d16387da
27 changed files with 223 additions and 205 deletions

View File

@@ -126,7 +126,7 @@ class WTVDownloadList {
* @param {string} destination Destination file path in the User Store
*/
putUserStoreDest(path, destination) {
this.put(path, `${this.service_name}:/userstore?partialPath=${encodeURIComponent(destination)}`);
this.put(path, `${this.service_name}:/userstore?partialPath=${this.wtvshared.escape(destination)}`);
}
/**

View File

@@ -92,7 +92,7 @@ class WTVGuide {
if (!link_word_start_letter && link_word_for_link.length > 0) link_word_start_letter = link_word_for_link.charAt(0).toUpperCase();
if (!link_word_override) link_word_override = link_word;
const link_url = `wtv-guide:/help?topic=Glossary&subtopic=${link_word_start_letter}&page=${link_word_for_link}&word=${encodeURIComponent(link_word_override)}`
const link_url = `wtv-guide:/help?topic=Glossary&subtopic=${link_word_start_letter}&page=${link_word_for_link}&word=${this.wtvshared.escape(link_word_override)}`
const new_definition = definition.slice(0, original_start - search.length) + `<a href="${link_url}">${link_word}</a>` + definition.slice(end + 7);
definition = new_definition;
}