Skip to content

Commit 7b4180f

Browse files
committed
text: Fix CSS color parsing with whitespace at the end
Flash Player strips whitespace when parsing CSS colors.
1 parent 42629a0 commit 7b4180f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/avm2/globals/flash/text/style_sheet.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub fn inner_parse_color<'gc>(
4646
let input = args.get_string(activation, 0);
4747

4848
if let Some(stripped) = input.strip_prefix(WStr::from_units(b"#")) {
49+
let stripped = stripped.trim_end();
4950
if stripped.len() <= 6 {
5051
if let Ok(number) = u32::from_str_radix(&stripped.to_string(), 16) {
5152
return Ok(number.into());

0 commit comments

Comments
 (0)