示例#1
0
 private String processLinkMetadata(
     ParserInput parserInput, ParserOutput parserOutput, int mode, String raw, WikiLink wikiLink)
     throws ParserException {
   String result = raw;
   if (!wikiLink.getColon() && wikiLink.getNamespace().getId().equals(Namespace.CATEGORY_ID)) {
     String sortKey = wikiLink.getText();
     if (!StringUtils.isBlank(sortKey)) {
       sortKey = JFlexParserUtil.parseFragment(parserInput, sortKey, JFlexParser.MODE_PREPROCESS);
     }
     parserOutput.addCategory(wikiLink.getDestination(), sortKey);
     if (mode > JFlexParser.MODE_MINIMAL) {
       // keep the category around in minimal parsing mode, otherwise suppress it from the output
       result = "";
     }
   }
   if (!StringUtils.isBlank(wikiLink.getDestination())) {
     parserOutput.addLink(wikiLink.getDestination());
   }
   return result;
 }
示例#2
0
 @Override
 public void addLink(String topic) {
   fParserOutput.addLink(topic);
 }