Skip to content

Commit

Permalink
normalise slash
Browse files Browse the repository at this point in the history
  • Loading branch information
interrogator committed Jun 9, 2020
1 parent 2f0a34d commit 791c879
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public CharSequence renderImageComponent(final Component component, String resou
String imagePath = imageComponent.getImages().get(0).getPath();
StringBuilder htmlBuilder = new StringBuilder();
htmlBuilder.append("<div class='component image-component'>");
htmlBuilder.append("<span>" + resourcesPath.concat("/").concat(imagePath) + "</span>");
htmlBuilder.append("<img src='" + resourcesPath.concat("/").concat(imagePath) + "' alt='Image' />");
// strip slash from resources path, ideally this is normalised earlier
htmlBuilder.append("<img src='" + resourcesPath.replaceAll("/$", "").concat("/").concat(imagePath) + "' alt='Image' />");
if (imageComponent.getCaption() != null) {
htmlBuilder.append("<p class='caption'>" + imageComponent.getCaption() + "</p>");
}
Expand Down

0 comments on commit 791c879

Please sign in to comment.