diff --git a/Jenkinsfile b/Jenkinsfile index bc42569..8c8b420 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -112,7 +112,14 @@ function unescapeXml(value) { function attr(attrs, name) { const needle = `${name}="`; - const start = attrs.indexOf(needle); + let start = attrs.indexOf(needle); + while (start > 0) { + const previous = attrs.charCodeAt(start - 1); + if (previous === 32 || previous === 9 || previous === 10 || previous === 13) { + break; + } + start = attrs.indexOf(needle, start + 1); + } if (start < 0) return ''; const valueStart = start + needle.length; const valueEnd = attrs.indexOf('"', valueStart);