17337: Added % sign handling in collection files
[arvados-workbench2.git] / src / common / xml.ts
index 3c6feb5dce8836a92a08074ba32a768af4ec84fc..751a327c77cb48ec64cc23611bb4834c5388e093 100644 (file)
@@ -4,7 +4,13 @@
 
 export const getTagValue = (document: Document | Element, tagName: string, defaultValue: string) => {
     const [el] = Array.from(document.getElementsByTagName(tagName));
-    return decodeURI(el ? htmlDecode(el.innerHTML) : defaultValue);
+    const URI = el ? htmlDecode(el.innerHTML) : defaultValue;
+
+    try {
+        return decodeURI(URI);
+    } catch(e) {}
+
+    return URI;
 };
 
 const htmlDecode = (input: string) => {