-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse_html ignoring white-spaces and newlines for <pre><code> ... </pre></code> html #4
Comments
rphtml is at fault! It parses I didn't see this earlier as most of the tests use struct RenderStatus {
inner_type: RenderStatuInnerType,
is_in_pre: bool,
root: bool,
} prove of parser faultA html parser MUST not parse inside a #[test]
fn test_childs() -> HResult {
let code = r##"<pre><p>aaa</p></pre>"##;
let doc = parse(code)?;
let root = doc.get_root_node();
let childs = &root.borrow().childs;
let childs = childs.as_ref().unwrap();
for child in childs {
println!(" - child: {:#?}\n", child);
}
assert_eq!(1,2);
Ok(())
}
|
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm having this issue ivanceras/sauron#107 and thought the cause was this parser.
However, recreating them in tests/html.rs sheds a different light on the issue and only the last test fails but the
<pre><code>...</code></pre>
stuff is alright as in your parser does not remove spaces, newlines or (supposedly) tabs.So maybe you want to add these tests also and fix the implementation - if you think it is worth fixing it.
correct and working
incorrect
The text was updated successfully, but these errors were encountered: