Skip to content

Commit

Permalink
Percent-encode fragments based on whatwg/url#169
Browse files Browse the repository at this point in the history
fixes servo#246
  • Loading branch information
Manishearth committed Dec 10, 2016
1 parent 4e7d48c commit a3e8a6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,12 +1083,13 @@ impl<'a> Parser<'a> {
}

pub fn parse_fragment(&mut self, mut input: Input) {
while let Some(c) = input.next() {
while let Some((c, utf8_c)) = input.next_utf8() {
if c == '\0' {
self.syntax_violation("NULL characters are ignored in URL fragment identifiers")
} else {
self.check_url_code_point(c, &input);
self.serialization.push(c); // No percent-encoding here.
self.serialization.extend(utf8_percent_encode(utf8_c,
SIMPLE_ENCODE_SET));
}
}
}
Expand Down

0 comments on commit a3e8a6d

Please sign in to comment.