#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 16 Jul 2018 19:47:29 +0200
changeset 1987 cefeb09f2d49
parent 1985 89923f26ec8a
child 1988 5960dfd0abd7
#BUGFIX by cg class: RegressionTests::HTMLParserTests added: #test06_comments text lost with comments.
RegressionTests__HTMLParserTests.st
--- a/RegressionTests__HTMLParserTests.st	Wed Jul 04 03:33:29 2018 +0000
+++ b/RegressionTests__HTMLParserTests.st	Mon Jul 16 19:47:29 2018 +0200
@@ -290,6 +290,39 @@
     "
 
     "Created: / 27-06-2018 / 15:28:31 / Claus Gittinger"
+!
+
+test06_comments
+     |doc bodyElement|
+
+    "/ verify: no ampersand escaping in style elements
+
+     UserNotification ignoreIn:[
+        doc := HTML::HTMLParser parseText:'
+<!!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<body>
+foo<!!--[foo]--><!!--bla-->bar
+<!!--[foo]--><!!--bla-->
+foo
+<!!--[foo]--><!!--bla-->
+bar
+<!!--[foo]--><!!--bla-->
+<p>
+foo bar &bla &froboz &amp; &amp foo
+</p>
+</body>
+</html>
+'.
+     ].
+     bodyElement := doc body.
+     self assert:(bodyElement extractedText = 'foo bar foo bar foo bar &bla &froboz & &amp foo').
+
+    "
+     self new test06_comments
+    "
+
+    "Created: / 16-07-2018 / 19:43:12 / Claus Gittinger"
 ! !
 
 !HTMLParserTests class methodsFor:'documentation'!