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
I encountered an issue where parsing breaks after a comment ending in ---> instead of the usual -->:
use tl::{parse,ParserOptions};fnmain(){let dom = parse(r#" <div class="ok"></div> <!-- Comment with extra hyphen >---> <div class="unreachable"></div> "#,ParserOptions::default()).unwrap();
dom.get_elements_by_class_name("ok").next().expect(".ok node");
dom.get_elements_by_class_name("unreachable").next().expect(".unreachable node");}
If I'm reading this right, this checks for -- and skips it, then ends the loop if the next char is >. My weird example breaks this assumption: the next char sequence after skipping is ->, so the loop continues until eof. An even number of dashes would work, but an odd number wouldn't. Maybe instead check for a single dash with > following instead of --?
I encountered an issue where parsing breaks after a comment ending in
--->
instead of the usual-->
:Printing the DOM:
The last node is the comment, and it's parsed as if it's empty. Removing the extra dash produces the expected result
The text was updated successfully, but these errors were encountered: