mirror of
https://github.com/servo/servo.git
synced 2025-06-10 09:33:13 +00:00
Don't crash on invalid utf-8 in the HTML parser.
This was regressed by the html5ever landing.
This commit is contained in:
parent
65856dd00a
commit
b9d8533760
4 changed files with 5 additions and 6 deletions
|
@ -496,7 +496,7 @@ pub fn parse_html(page: &Page,
|
|||
match msg {
|
||||
Payload(data) => {
|
||||
// FIXME: use Vec<u8> (html5ever #34)
|
||||
let data = String::from_utf8(data).unwrap();
|
||||
let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();
|
||||
parser.tokenizer().borrow_mut().feed(data);
|
||||
}
|
||||
Done(Err(err)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue