Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
fix links in quick doc
Browse files Browse the repository at this point in the history
  • Loading branch information
shalupov committed Jul 6, 2015
1 parent 32ef0ec commit ff4aa51
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public String createResourceDescription(PsiElement element) {
String propertyText = property.getValue() != null ? property.getValue().getText() : "";

if (resourceType.name.equals(propertyText.replace("\"", "")))
return resourceType.description.replace("href=\"(?!http)", "href=\"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/");
return prefixLinksWithUserGuideRoot(resourceType.description);
}

return "";
Expand Down Expand Up @@ -103,7 +103,7 @@ public String createPropertyDescription(PsiElement element) {
propertyMetadata.type +
propertyMetadata.updateRequires;

return document.replace("href=\"(?!http)", "href=\"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/");
return prefixLinksWithUserGuideRoot(document);
}

}
Expand Down Expand Up @@ -134,4 +134,8 @@ public PsiElement getCustomDocumentationElement(@NotNull Editor editor, @NotNull
public Image getLocalImageForElement(@NotNull PsiElement element, @NotNull String imageSpec) {
return null;
}

private static String prefixLinksWithUserGuideRoot(String html) {
return html.replaceAll("href=\"(?!http)", "href=\"http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/");
}
}

0 comments on commit ff4aa51

Please sign in to comment.