|
|
@@ -1909,24 +1909,19 @@ class ProcessorHelper {
|
|
|
// ignored
|
|
|
}
|
|
|
if (testValidURL(resourceURL)) {
|
|
|
- let svgDoc;
|
|
|
- if (!originalResourceURL.startsWith(baseURI + "#")) {
|
|
|
- const response = await batchRequest.addURL(resourceURL);
|
|
|
- svgDoc = util.parseSVGContent(response.content);
|
|
|
- } else {
|
|
|
- svgDoc = doc;
|
|
|
- }
|
|
|
const hashMatch = originalResourceURL.match(REGEXP_URL_HASH);
|
|
|
if (hashMatch && hashMatch[0]) {
|
|
|
- let symbolElement;
|
|
|
- try {
|
|
|
- symbolElement = svgDoc.querySelector(hashMatch[0]);
|
|
|
- } catch (error) {
|
|
|
- // ignored
|
|
|
- }
|
|
|
- if (symbolElement) {
|
|
|
+ if (originalResourceURL.startsWith(baseURI + "#")) {
|
|
|
resourceElement.setAttribute(attributeName, hashMatch[0]);
|
|
|
- resourceElement.parentElement.insertBefore(symbolElement, resourceElement.parentElement.firstChild);
|
|
|
+ } else {
|
|
|
+ const response = await batchRequest.addURL(resourceURL);
|
|
|
+ const svgDoc = util.parseSVGContent(response.content);
|
|
|
+ try {
|
|
|
+ const symbolElement = svgDoc.querySelector(hashMatch[0]);
|
|
|
+ resourceElement.parentElement.replaceChild(symbolElement, resourceElement);
|
|
|
+ } catch (error) {
|
|
|
+ // ignored
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
const content = await batchRequest.addURL(resourceURL);
|