Package org.wikipediacleaner.api.check

Examples of org.wikipediacleaner.api.check.CheckErrorResult.addReplacement()


          }
          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(
              analysis,
              tag.getBeginIndex(), tag.getEndIndex());
          errorResult.addReplacement("");
          errors.add(errorResult);
        }
      } else if (tag.isEndTag()) {
        // Closing tag
        level--;
View Full Code Here


          }
          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(
              analysis,
              tag.getBeginIndex(), tag.getEndIndex());
          errorResult.addReplacement("");
          errors.add(errorResult);
        }
      } else {
        if (level == 0) {
          level0Tag = tag;
View Full Code Here

            if (possibleEnd > 0) {
              CheckErrorResult errorResult = createCheckErrorResult(
                  analysis,
                  level0Tag.getBeginIndex(), possibleEnd,
                  ErrorLevel.WARNING);
              errorResult.addReplacement(
                  contents.substring(level0Tag.getBeginIndex(), possibleEnd) + "</small>",
                  "<small>...</small>");
              errors.add(errorResult);
            } else {
              CheckErrorResult errorResult = createCheckErrorResult(
View Full Code Here

          int possibleEnd = getPossibleEnd(analysis, tag);
          if (possibleEnd > 0) {
            CheckErrorResult errorResult = createCheckErrorResult(
                analysis, tag.getBeginIndex(), possibleEnd);
            errorResult.addReplacement(
                contents.substring(tag.getBeginIndex(), possibleEnd) + "</small>",
                "<small>...</small>");
            errors.add(errorResult);
          } else {
            CheckErrorResult errorResult = createCheckErrorResult(
View Full Code Here

            CheckErrorResult errorResult = createCheckErrorResult(
                analysis,
                tag.getCompleteBeginIndex(),
                tag.getCompleteEndIndex());
            if (doubleSmall) {
              errorResult.addReplacement(
                  contents.substring(tag.getEndIndex(), tag.getMatchingTag().getBeginIndex()),
                  GT._("Remove <small> tags"));
            }
            if (!tag.isComplete() && !tag.isFullTag() && !tag.isEndTag()) {
              errorResult.addReplacement(
View Full Code Here

              errorResult.addReplacement(
                  contents.substring(tag.getEndIndex(), tag.getMatchingTag().getBeginIndex()),
                  GT._("Remove <small> tags"));
            }
            if (!tag.isComplete() && !tag.isFullTag() && !tag.isEndTag()) {
              errorResult.addReplacement(
                  PageElementTag.createTag(PageElementTag.TAG_HTML_SMALL, true, false));
            }
            errors.add(errorResult);
            if (tag.isComplete()) {
              tagIndex = PageElementTag.getMatchingTagIndex(tags, tagIndex);
View Full Code Here

              lastIndex = smallTag.getEndIndex();
            }
            if (lastIndex < description.length()) {
              replacement.append(description.substring(lastIndex));
            }
            errorResult.addReplacement(
                image.getDescriptionReplacement(replacement.toString()),
                GT._("Remove {0} tags", "<small>"));
            errors.add(errorResult);
          }
        }
View Full Code Here

          }

          // Create internal link
          if (link.hasSquare() && link.hasSecondSquare()) {
            boolean first = (errorResult.getPossibleActions() == null) || (errorResult.getPossibleActions().isEmpty());
            errorResult.addReplacement(
                "[[:" + prefix + ":" + article + "|" + (link.getText() != null ? link.getText() : article) + "]]",
                first);
          }
          errors.add(errorResult);
        }
View Full Code Here

              return true;
            }
            result = true;
            CheckErrorResult errorResult = createCheckErrorResult(
                analysis, beginIndex, endIndex);
            errorResult.addReplacement("");
            errors.add(errorResult);
          }
        } else if (tag.isEndTag()) {

          // Closing tag with white space (detected by CW)
View Full Code Here

              return true;
            }
            result = true;
            CheckErrorResult errorResult = createCheckErrorResult(
                analysis, beginIndex, endIndex, ErrorLevel.WARNING);
            errorResult.addReplacement(
                PageElementTag.createTag(tagName, true, false),
                true);
            errors.add(errorResult);
          }
        }
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.