Skip to content

Commit

Permalink
Allow any extended ASCII in attribute value parser
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d committed Sep 28, 2024
1 parent 870cb1b commit a6bbb58
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/parser/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ pub fn attribute_name<'s>(input: &mut &'s str) -> PResult<&'s str> {
.parse_next(input)
}

// An ASCII sequence of characters, excluding control.
// An extended ASCII sequence of characters, excluding control.
pub fn attribute_value<'s>(input: &mut &'s str) -> PResult<&'s str> {
take_while(0.., |c: char| c.is_ascii() && !c.is_ascii_control()).parse_next(input)
take_while(0.., |c: char| {
matches!(c, '\u{0000}'..='\u{00FF}') && !c.is_ascii_control()
})
.parse_next(input)
}

// Extends an attributes value over multiple lines.
Expand Down

0 comments on commit a6bbb58

Please sign in to comment.