Search in sources :

Example 1 with LoggingCSSParseExceptionCallback

use of com.helger.css.handler.LoggingCSSParseExceptionCallback in project ph-css by phax.

the class Issue34Test method testIssue.

@Test
@Ignore("TODO")
public void testIssue() {
    final String css = ".pen {background-color:red} {* some incorrect block *} .pen {background-color: blue}";
    final CSSReaderSettings aSettings = new CSSReaderSettings().setCSSVersion(ECSSVersion.LATEST).setBrowserCompliantMode(true).setCustomErrorHandler(new LoggingCSSParseErrorHandler()).setCustomExceptionHandler(new LoggingCSSParseExceptionCallback());
    final CascadingStyleSheet cascadingStyleSheet = CSSReader.readFromStringStream(css, aSettings);
    assertNotNull(cascadingStyleSheet);
    final CSSWriter writer = new CSSWriter(new CSSWriterSettings(ECSSVersion.LATEST, true));
    s_aLogger.info(writer.getCSSAsString(cascadingStyleSheet));
}
Also used : CascadingStyleSheet(com.helger.css.decl.CascadingStyleSheet) CSSWriterSettings(com.helger.css.writer.CSSWriterSettings) LoggingCSSParseExceptionCallback(com.helger.css.handler.LoggingCSSParseExceptionCallback) CSSWriter(com.helger.css.writer.CSSWriter) CSSReaderSettings(com.helger.css.reader.CSSReaderSettings) LoggingCSSParseErrorHandler(com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

CascadingStyleSheet (com.helger.css.decl.CascadingStyleSheet)1 LoggingCSSParseExceptionCallback (com.helger.css.handler.LoggingCSSParseExceptionCallback)1 CSSReaderSettings (com.helger.css.reader.CSSReaderSettings)1 LoggingCSSParseErrorHandler (com.helger.css.reader.errorhandler.LoggingCSSParseErrorHandler)1 CSSWriter (com.helger.css.writer.CSSWriter)1 CSSWriterSettings (com.helger.css.writer.CSSWriterSettings)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1