#FEATURE by Maren
class: RegressionTests::HTMLParserTests
added: #test08_ScriptWithCommentScript
HTML with script within a comment in a script
--- a/RegressionTests__HTMLParserTests.st Mon Jul 29 11:07:08 2019 +0200
+++ b/RegressionTests__HTMLParserTests.st Tue Jul 30 16:26:19 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"{ Package: 'stx:goodies/regression' }"
"{ NameSpace: RegressionTests }"
@@ -502,7 +500,7 @@
<img id="sbin-image" src="" alt="Sessel-Loungesessel-Clubsessel-Stoff-blau-Sitzmoebel-Wohnmoebel-Frenco" expeccoid="da17cef8-be1f-43e4-90c4-fca6dfcec4f9">
</div>
<div id="sbin-text-content" expeccoid="832f96ee-e300-48e7-97c7-29b892330546">
- <p class="sbin-title" expeccoid="2132b498-9bee-4b28-a378-88d73eaf8a36">Sessel Loungesessel Clubsessel Stoff blau Sitzmöbel Wohnmöbel Frenco</p>
+ <p class="sbin-title" expeccoid="2132b498-9bee-4b28-a378-88d73eaf8a36">Sessel Loungesessel Clubsessel Stoff blau Sitzmöbel Wohnmöbel Frenco</p>
</div>
</div>
@@ -568,7 +566,7 @@
</tr>
</tbody></table>
</div><div id="why2buy" expeccoid="4dd9c815-7d7b-44ed-a621-6b7f9ec05bc4"><div class="w2b w2bsls" expeccoid="794cddbf-0231-4a1d-98f5-bf5eb9eb8d40">
- <div class="w2b-cnt w2b-3 w2b-red" expeccoid="0f21cf97-b244-4591-a91f-4aebb1be933e"><span class="w2b-sgl" expeccoid="fdedce8d-4b45-46dc-bfb1-c3bf05452897">Inlandsversand und Rücksendung kostenlos</span></div>
+ <div class="w2b-cnt w2b-3 w2b-red" expeccoid="0f21cf97-b244-4591-a91f-4aebb1be933e"><span class="w2b-sgl" expeccoid="fdedce8d-4b45-46dc-bfb1-c3bf05452897">Inlandsversand und Rücksendung kostenlos</span></div>
<div class="w2b-cnt w2b-3 w2b-brdr" expeccoid="df7655ce-6661-46cb-8c9d-b449eb026c0f"><span class="w2b-sgl" expeccoid="9869da07-2f91-4392-971c-0d96e271d118">Versand aus Deutschland</span></div>
<div class="w2b-cnt w2b-3 w2b-brdr" expeccoid="68101fa3-aad3-474d-8556-e1024fc63832"><span class="w2b-sgl" expeccoid="fea7ce21-3bb2-4971-b7e6-945ce8e91870">9 Beobachter</span></div>
</div>
@@ -581,6 +579,32 @@
"
"Created: / 24-05-2019 / 14:34:10 / Claus Gittinger"
+!
+
+test08_ScriptWithCommentScript
+ |doc|
+
+ "/ when getting ebay's innerhtml, we get the following from firefox
+ "/ (which is invalid in the '<a role="button" _sp="p2047675.l1473" ... line)
+
+ UserNotification ignoreIn:[
+ doc := HTML::HTMLParser parseText:'
+<html expeccoid="c8f07039-eaad-48b3-adbd-1a40c564043e"><head expeccoid="5c26724b-2ef1-45a8-bbc8-73fc68139187"></head>
+<body>
+ <script type="text/javascript" expeccoid="3fb6832a-6f1d-40e2-b21c-ba6c620b2a1e">
+ <!!--
+ document.write(''<script type="text/javascript" src=""></script>'');
+ //-->
+ </script>
+</body></html>
+'.
+ ].
+
+ "
+ self new test08_ScriptWithCommentScript
+ "
+
+ "Created: / 30-07-2019 / 16:24:14 / Maren"
! !
!HTMLParserTests class methodsFor:'documentation'!