Package info.bliki.htmlcleaner

Examples of info.bliki.htmlcleaner.ContentToken


        Object item = childrenIt.next();
        if (item != null) {
          if (item instanceof List) {
            nodesToText((List) item, resultBuffer, model);
          } else if (item instanceof ContentToken) {
            ContentToken contentToken = (ContentToken) item;
            resultBuffer.append(texEscapeString(contentToken.getContent()));
          } else if (item instanceof HTMLTag) {
            renderLaTeX(((HTMLTag) item), this, resultBuffer, model);
          } else if (item instanceof TagNode) {
            TagNode node = (TagNode) item;
            Map map = node.getObjectAttributes();
View Full Code Here


      aTagNode.addAttribute("href", link, true);
      aTagNode.addAttribute("class", "telephonelink", true);
      aTagNode.addAttribute("title", link, true);
      if (withoutSquareBrackets) {
        append(aTagNode);
        aTagNode.addChild(new ContentToken(linkName));
      } else {
        String trimmedText = linkName.trim();
        if (trimmedText.length() > 0) {
          pushNode(aTagNode);
          WikipediaParser.parseRecursive(trimmedText, this, false, true);
View Full Code Here

      aTagNode.addAttribute("href", link, true);
      aTagNode.addAttribute("class", "telephonelink", true);
      aTagNode.addAttribute("title", link, true);
      if (withoutSquareBrackets) {
        append(aTagNode);
        aTagNode.addChild(new ContentToken(linkName));
      } else {
        String trimmedText = linkName.trim();
        if (trimmedText.length() > 0) {
          pushNode(aTagNode);
          WikipediaParser.parseRecursive(trimmedText, this, false, true);
View Full Code Here

    if (fWhiteStart) {
      try {
        final int whiteEndPosition = fCurrentPosition - diff;
        int count = whiteEndPosition - fWhiteStartPosition;
        if (count > 0) {
          fWikiModel.append(new ContentToken(fStringSource.substring(fWhiteStartPosition, fWhiteStartPosition + count)));
        }
      } finally {
        fWhiteStart = false;
      }
    }
View Full Code Here

        fWikiModel.append(tag);
      } else {
        fWikiModel.pushNode(tag);
        if (null != bodyString) {
          if (tag instanceof INoBodyParsingTag) {
            ((TagNode) tag).addChild(new ContentToken(bodyString));
          } else {
            // recursively filter tags within the tags body string
            WikipediaParser.parseRecursive(bodyString.trim(), fWikiModel, false, true);
          }
        }
        if (tag instanceof IBodyTag) {
          fWikiModel.popNode();
        }
      }
    } catch (IllegalArgumentException e) {
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken("IllegalArgumentException: " + command + " - " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    } catch (Throwable e) {
      e.printStackTrace();
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken(command + ": " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    }
  }
View Full Code Here

        fWikiModel.append(tag);
      } else {
        fWikiModel.pushNode(tag);
        if (null != bodyString) {
          if (tag instanceof INoBodyParsingTag) {
            ((TagNode) tag).addChild(new ContentToken(bodyString));
          } else {
            // recursively filter tags within the tags body string
            WikipediaParser.parseRecursive(bodyString.trim(), fWikiModel, false, true);
          }
        }
        if (tag instanceof IBodyTag) {
          fWikiModel.popNode();
        }
      }
    } catch (IllegalArgumentException e) {
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken("IllegalArgumentException: " + command + " - " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    } catch (Throwable e) {
      e.printStackTrace();
      TagNode divTagNode = new TagNode("div");
      divTagNode.addAttribute("class", "error", true);
      divTagNode.addChild(new ContentToken(command + ": " + e.getMessage()));
      fWikiModel.append(divTagNode);
      e.printStackTrace();
    }
  }
View Full Code Here

    aTagNode.addAttribute("rel", "nofollow", true);
    if (withoutSquareBrackets) {
      aTagNode.addAttribute("class", "externallink", true);
      aTagNode.addAttribute("title", link, true);
      append(aTagNode);
      aTagNode.addChild(new ContentToken(linkName));
    } else {
      String trimmedText = linkName.trim();
      if (trimmedText.length() > 0) {
        pushNode(aTagNode);
        if (linkName.equals(link)) {
          if (withoutSquareBrackets) {
            aTagNode.addAttribute("class", "externallink", true);
            aTagNode.addAttribute("title", link, true);
            aTagNode.addChild(new ContentToken(trimmedText));
          } else {
            aTagNode.addAttribute("class", "external autonumber", true);
            aTagNode.addChild(new ContentToken("[" + (++fExternalLinksCounter) + "]"));
          }
        } else {
          aTagNode.addAttribute("class", "externallink", true);
          aTagNode.addAttribute("title", link, true);
          WikipediaParser.parseRecursive(trimmedText, this, false, true);
View Full Code Here

    pushNode(aTagNode);
    if (parseRecursive) {
      WikipediaParser.parseRecursive(topicDescription.trim(), this, false, true);
    } else {
      aTagNode.addChild(new ContentToken(topicDescription));
    }
    popNode();

    // ContentToken text = new ContentToken(topicDescription);
    // aTagNode.addChild(text);
View Full Code Here

    append(aTagNode);
    aTagNode.addAttribute("href", isbnString, true);
    aTagNode.addAttribute("class", "external text", true);
    aTagNode.addAttribute("title", isbnString, true);
    aTagNode.addAttribute("rel", "nofollow", true);
    aTagNode.addChild(new ContentToken(isbnPureText));
  }
View Full Code Here

    append(aTagNode);
    aTagNode.addAttribute("href", link, true);
    aTagNode.addAttribute("class", "external free", true);
    aTagNode.addAttribute("title", link, true);
    aTagNode.addAttribute("rel", "nofollow", true);
    aTagNode.addChild(new ContentToken(linkName));
  }
View Full Code Here

TOP

Related Classes of info.bliki.htmlcleaner.ContentToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.