net.html: fix parsing of nested quoted strings in code tags (#18123)

This commit is contained in:
Turiiya 2023-05-07 02:55:02 +02:00 committed by GitHub
parent 1c3af091f7
commit 39ec1134fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 14 deletions

View file

@ -62,7 +62,7 @@ fn test_giant_string() {
fn test_script_tag() {
mut parser := Parser{}
script_content := "\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];if(3 > 5) {console.log('Birl');}\n"
script_content := '\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];if(3 > 5) {console.log("Quoted \'message\'");}\n'
temp_html := '<html><body><script>${script_content}</script></body></html>'
parser.parse_html(temp_html)
assert parser.tags[2].content.len == script_content.len