Class CommentRemover

java.lang.Object
io.sf.carte.doc.style.css.parser.CommentRemover

public class CommentRemover extends Object
Utility class that removes CSS comments from a string.
  • Constructor Details

    • CommentRemover

      public CommentRemover()
  • Method Details

    • removeComments

      public static StringBuilder removeComments(String cssText)
      Takes a string and returns a StringBuilder with the CSS comments removed.
      Parameters:
      cssText - the CSS text to remove comments from.
      Returns:
      a StringBuilder containing the text with the comments removed.
    • removeCommentsUntil

      public static StringBuilder removeCommentsUntil(String cssText, int removeUntilIdx)
      Takes a string and returns a StringBuilder with the CSS comments preceding the given index removed.
      Parameters:
      cssText - the CSS text to remove comments from.
      removeUntilIdx - the index after which the comments won't be removed.
      Returns:
      a StringBuilder containing the text with the comments removed.