code: private void deleteComments(SpanManager sm)
  	{
  		int start = 0;
  		while ((start = sm.indexOf("<!--", start)) != -1)
  		{
  			int end = sm.indexOf("-->", start + 4) + 3;
  			if (end == -1 + 3)
  			{
  				end = sm.length();
  			}
  
  			// Remove the one lineSeparator too, if the whole line is a comment!
  			try
  			{
  				if (lineSeparator.equals(sm.substring(start
  						- lineSeparator.length(), start))
  						&& lineSeparator.equals(sm.substring(end, end
  								+ lineSeparator.length())))
  				{
  					end += lineSeparator.length();
  				}
  			}
  			catch (IndexOutOfBoundsException e)
  			{}
  
  			sm.delete(start, end);
  		}
  	}
docs: Deleting all comments out of the SpanManager...<br>
  &lt!-- COMMENT -->