code: public String getUrl(String htmlLink) {
          String result = htmlLink;
          if (htmlLink != null) {
              Matcher linkMatcher = LINKPATTERN.matcher(htmlLink);
              Matcher imgMatcher = IMAGEPATTERN.matcher(htmlLink);
              if (linkMatcher.matches()) {
                  String href = linkMatcher.group(2);
                  href = StringEscapeUtils.unescapeHtml4(href);
                  result = href + linkMatcher.group(4);
              } else if (imgMatcher.matches()) {
                  String src = imgMatcher.group(2);
                  result = StringEscapeUtils.unescapeHtml4(src);
              }
          }
          return result;
      }
docs: Gets a URL from a wiki page value.
  @param htmlLink link as present on wiki page.
  @return address the link points to (if it is an 'a'), the original link otherwise.