Examples of PageElementComment


Examples of org.wikipediacleaner.api.data.PageElementComment

      if ((nextTitle == null) ||
          (nextTitle.getLevel() <= title.getLevel())) {
        boolean textFound = false;
        int lastPos = (nextTitle != null) ? nextTitle.getBeginIndex() : contents.length();
        int pos = title.getEndIndex();
        PageElementComment commentFound = null;
        while (!textFound && (pos < lastPos)) {
          char currentChar = contents.charAt(pos);
          if (Character.isWhitespace(currentChar)) {
            pos++;
          } else if (currentChar == '<') {
            PageElementComment comment = analysis.isInComment(pos);
            if (comment != null) {
              pos = comment.getEndIndex();
              if (commentFound == null) {
                commentFound = comment;
              }
            } else {
              textFound = true;
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

        }
      }

      // Check if inside a comment
      if (shouldCheck) {
        PageElementComment comment = analysis.isInComment(currentIndex);
        if (comment != null) {
          nextIndex = comment.getEndIndex();
          shouldCheck = false;
        }
      }

      // Check if inside a specific tag
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

      String contents = analysis.getContents();
      while ((currentIndex < contents.length()) &&
             (currentCount < location)) {
        boolean moved = false;
        if (!moved) {
          PageElementComment comment = analysis.isInComment(currentIndex);
          if ((comment != null) && (comment.getBeginIndex() == currentIndex)) {
            moved = true;
            currentIndex = comment.getEndIndex();
          }
        }
        // TODO: ignore other things
        if (!moved) {
          currentIndex++;
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

      int nextIndex = currentIndex + 1;
      boolean shouldCheck = true;

      // Check if we are in a comment
      if (shouldCheck) {
        PageElementComment comment = analysis.isInComment(currentIndex);
        if (comment != null) {
          shouldCheck = false;
          nextIndex = comment.getEndIndex();
        }
      }

      // Check if this is a br tag
      if ((shouldCheck) && (contents.charAt(currentIndex) == '<')) {
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

        int currentPos = end;
        while ((currentPos < maxSize) && (contents.charAt(currentPos) == ' ')) {
          currentPos++;
        }
        if ((currentPos < maxSize) && (contents.charAt(currentPos) == '<')) {
          PageElementComment comment = pageAnalysis.isInComment(currentPos);
          if (comment != null) {
            for (String commentAfter : commentsAfter) {
              String comment2 = comment.getComment();
              if ((comment2 != null) && (comment2.length() >= commentAfter.length())) {
                comment2 = comment2.substring(0, commentAfter.length());
                if (comment2.equalsIgnoreCase(commentAfter)) {
                  styleType = ConfigurationValueStyle.INTERNAL_LINK_NORMAL;
                  end = comment.getEndIndex();
                }
              }
            }
          }
        }
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

              shouldCount = false;
            }
          }
          if (shouldCount) {
            // Check for comment
            PageElementComment comment = analysis.isInComment(currentIndex);
            if (comment != null) {
              shouldCount = false;
            }
          }
          if (shouldCount) {
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

          int paramValueStartIndex = template.getParameterValueStartIndex(paramNum);
          for (int currentPos = 0; currentPos < paramValue.length(); currentPos++) {
            switch (paramValue.charAt(currentPos)) {
            case '<':
              int tmpIndex = paramValueStartIndex + currentPos;
              PageElementComment comment = analysis.isInComment(tmpIndex);
              if (comment != null) {
                currentPos = comment.getEndIndex() - 1 - paramValueStartIndex;
              } else {
                PageElementTag tag = analysis.isInTag(tmpIndex);
                if ((tag != null) &&
                    (tag.getBeginIndex() == tmpIndex) &&
                    ((PageElementTag.TAG_WIKI_MATH.equals(tag.getNormalizedName())) ||
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

      while (!textFound &&
             (currentIndex < lastIndex) &&
             (contents.charAt(currentIndex) != '=')) {
        currentIndex = getFirstIndexAfterSpace(contents, currentIndex);
        if (currentIndex < lastIndex) {
          PageElementComment comment = null;
          PageElementTag tag = null;
          char currentChar = contents.charAt(currentIndex);
          if (currentChar == '<') {
            comment = analysis.isInComment(currentIndex);
            tag = analysis.isInTag(currentIndex, PageElementTag.TAG_WIKI_NOWIKI);
          }
          if (comment != null) {
            currentIndex = comment.getEndIndex();
          } else if (tag != null) {
            currentIndex = tag.getCompleteEndIndex();
          } else if (currentChar != '=') {
            if (!Character.isWhitespace(currentChar)) {
              textFound = true;
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

      int index = isbn.getEndIndex();
      while ((index < contents.length()) && (contents.charAt(index) == ' ')) {
        index++;
      }
      if ((index < contents.length()) && (contents.charAt(index) == '<')) {
        PageElementComment comment = analysis.isInComment(index);
        if (comment != null) {
          level = ErrorLevel.WARNING;
        }
      }
    }
View Full Code Here

Examples of org.wikipediacleaner.api.data.PageElementComment

                    endError = tag.getCompleteBeginIndex();
                    currentValuePos -= tag.getEndIndex() - tag.getCompleteBeginIndex();
                  }
                }
              } else {
                PageElementComment comment = analysis.isInComment(paramValueStartIndex + currentValuePos);
                if (comment != null) {
                  replacement += analysis.getContents().substring(comment.getBeginIndex(), comment.getEndIndex());
                  shouldStop = false;
                  currentValuePos -= comment.getEndIndex() - comment.getBeginIndex();
                }
              }
            }
          }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.