@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
if (c == '!') { if (skip("--", false)) { scanComment();
if (c == '!') { if (skip("--", false)) { scanComment();