X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f5f72a4ee9b00aab5492f8991677b6503a6f2ac3..f616027fe6cc593b7aec49e38c8d9203a3a35aa4:/src/common/xml.ts diff --git a/src/common/xml.ts b/src/common/xml.ts index 751a327c..e7db3aca 100644 --- a/src/common/xml.ts +++ b/src/common/xml.ts @@ -2,13 +2,17 @@ // // SPDX-License-Identifier: AGPL-3.0 -export const getTagValue = (document: Document | Element, tagName: string, defaultValue: string) => { +import { customDecodeURI } from "./url"; + +export const getTagValue = (document: Document | Element, tagName: string, defaultValue: string, skipDecoding: boolean = false) => { const [el] = Array.from(document.getElementsByTagName(tagName)); const URI = el ? htmlDecode(el.innerHTML) : defaultValue; - try { - return decodeURI(URI); - } catch(e) {} + if (!skipDecoding) { + try { + return customDecodeURI(URI); + } catch(e) {} + } return URI; };