diff --git a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java index a571a08524..74b464f238 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoHtmlParser.java @@ -180,6 +180,7 @@ public void parse(final WebResponse webResponse, final HtmlPage page, domBuilder.setFeature(HTMLScanner.ALLOW_SELFCLOSING_TAGS, true); domBuilder.setFeature(HTMLScanner.SCRIPT_STRIP_CDATA_DELIMS, true); domBuilder.setFeature(HTMLScanner.STYLE_STRIP_CDATA_DELIMS, true); + domBuilder.setFeature(HTMLScanner.CDATA_EARLY_CLOSING, false); } } catch (final Exception e) { diff --git a/src/test/java/org/htmlunit/html/XHtmlPage2Test.java b/src/test/java/org/htmlunit/html/XHtmlPage2Test.java index 21c7f1c57c..02a45eb281 100644 --- a/src/test/java/org/htmlunit/html/XHtmlPage2Test.java +++ b/src/test/java/org/htmlunit/html/XHtmlPage2Test.java @@ -19,6 +19,7 @@ import org.htmlunit.WebDriverTestCase; import org.htmlunit.junit.BrowserRunner; import org.htmlunit.junit.BrowserRunner.Alerts; +import org.htmlunit.junit.BrowserRunner.HtmlUnitNYI; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -83,4 +84,100 @@ public void selfClosingTextarea() throws Exception { assertEquals("", driver.findElement(By.id("myText")).getText()); } + + /** + * Regression test for Bug #1219. + * + * @throws Exception if an error occurs + */ + @Test + @Alerts({"beforeafter", + "