Skip to content

Commit

Permalink
replaced resource resolver with symlink version (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
benradey committed Apr 29, 2021
1 parent a19fbb1 commit 33c27f6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.redhat.pantheon.asciidoctor.extension;

import com.redhat.pantheon.helper.Symlinks;
import com.redhat.pantheon.model.Xref;
import com.redhat.pantheon.model.assembly.TableOfContents;
import com.redhat.pantheon.model.document.Document;
Expand Down Expand Up @@ -81,7 +82,7 @@ private String preprocessWithPattern(String line, Pattern pattern, List<String>
// Assume it's a relative path to a file in the same repo for now
Resource containingFolder = documentVariant.getParentLocale().getParent().getParent();
String targetPath = containingFolder.getPath() + "/" + filepath;
Resource desiredTarget = documentVariant.getResourceResolver().getResource(targetPath);
Resource desiredTarget = Symlinks.resolve(documentVariant.getResourceResolver(), targetPath);

if (desiredTarget != null && XREF_ALLOWED_TARGET_TYPES.contains(desiredTarget.getResourceType())) {
UUID uuid = UUID.randomUUID();
Expand Down

0 comments on commit 33c27f6

Please sign in to comment.