Package org.wikipediacleaner.api.check

Examples of org.wikipediacleaner.api.check.HtmlCharacters


      }
      if ((tmpIndex > startIndex) &&
          (tmpIndex < maxLength) &&
          (contents.charAt(tmpIndex) == ';')) {
        int entityNumber = Integer.parseInt(contents.substring(startIndex, tmpIndex), radix);
        HtmlCharacters htmlCharacter = HtmlCharacters.getCharacterByEntityNumber(entityNumber);
        boolean shouldReplace = true;
        if (htmlCharacter != null) {
          shouldReplace = htmlCharacter.shouldReplaceNumeric();
          if (HtmlCharacters.SYMBOL_VERTICAL_BAR.equals(htmlCharacter) &&
              (analysis.isInTemplate(ampersandIndex) != null)) {
            shouldReplace = false;
          }
        }
        if (shouldReplace) {
          if (errors == null) {
            return true;
          }
          result = true;
          CheckErrorResult errorResult = createCheckErrorResult(
              analysis, ampersandIndex, tmpIndex + 1,
              htmlCharacter != null ? ErrorLevel.ERROR : ErrorLevel.WARNING);
          if (htmlCharacter != null) {
            errorResult.addReplacement("" + htmlCharacter.getValue(), true);
          } else {
            errorResult.addReplacement("" + (char) entityNumber, false);
          }
          errors.add(errorResult);
        }
View Full Code Here

TOP

Related Classes of org.wikipediacleaner.api.check.HtmlCharacters

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.