You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env perluse v5.12.0;
use warnings;
use Mojo::DOM;
my$dom = Mojo::DOM->new(do { local$/; scalar readline DATA });
sayfor$dom->find('p')->each;
__DATA__<!DOCTYPE html><h1>Welcome to HTML</h1><script> console.log('this is a script element and should be executed');// </script asdf> <p> console.log('this is not a script'); // <span data-wtf="</script>">:-)</span>
Expected behavior
Output similar to:
<p>
console.log('this is not a script');
// <spandata-wtf="</script>">:-)</span></p>
An (implicitly closed) p element exists, so it should be found.
Actual behavior
No output.
The text was updated successfully, but these errors were encountered:
After seeing </ (followed by a letter) in a <script> element, we end up in the "script data end tag name" state. Here we accumulate letters into the name of a temporary tag. On seeing whitespace (space, tab, line feed, form feed), we check that the temporary tag name matches "script"; if so, we stop script parsing (treating the characters found as a script end tag) and continue parsing for attributes.
Steps to reproduce the behavior
Expected behavior
Output similar to:
An (implicitly closed)
p
element exists, so it should be found.Actual behavior
No output.
The text was updated successfully, but these errors were encountered: