Exemple #1
0
 /**
  * Disable all <tt><SCRIPT></tt> tags in <tt>aText</tt>.
  *
  * <p>Insensitive to case.
  */
 public static String forScriptTagsOnly(String aText) {
   String result = null;
   Matcher matcher = SCRIPT.matcher(aText);
   result = matcher.replaceAll("&lt;SCRIPT>");
   matcher = SCRIPT_END.matcher(result);
   result = matcher.replaceAll("&lt;/SCRIPT>");
   return result;
 }
Exemple #2
0
    /**
     * @param token The token to analyse.
     * @return The text size corresponding to the given latex token or null.
     * @since 3.0
     */
    public static TextSize getTextSizeFromToken(final String token) {
      TextSize textSize;

      if (TINY.equals(token)) textSize = TINY;
      else if (FOOTNOTE.equals(token)) textSize = FOOTNOTE;
      else if (HUGE1.equals(token)) textSize = HUGE1;
      else if (HUGE2.equals(token)) textSize = HUGE2;
      else if (LARGE1.equals(token)) textSize = LARGE1;
      else if (LARGE2.equals(token)) textSize = LARGE2;
      else if (LARGE3.equals(token)) textSize = LARGE3;
      else if (NORMAL.equals(token)) textSize = NORMAL;
      else if (SCRIPT.equals(token)) textSize = SCRIPT;
      else if (SMALL.equals(token)) textSize = SMALL;
      else textSize = null;

      return textSize;
    }