X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f5f72a4ee9b00aab5492f8991677b6503a6f2ac3..98d3f7708860701b02055643da4ba9412720bf4b:/src/common/xml.ts diff --git a/src/common/xml.ts b/src/common/xml.ts index 751a327c77..e7db3acad8 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; };