Skip to content

Commit e0b6c8c

Browse files
committed
fix(transformer/react): correct comment (#10323)
Fix comment in function for decoding HTML entities in `JSXText` elements. Hex code escape is `ሴ` not `&x1234;`. Also reformat comments in this function.
1 parent 294d24b commit e0b6c8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/oxc_transformer/src/jsx/jsx_impl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,22 +1022,22 @@ impl<'a> JsxImpl<'a, '_> {
10221022
if let Some(c) =
10231023
u32::from_str_radix(hex, 16).ok().and_then(char::from_u32)
10241024
{
1025-
// &x0123;
1025+
// `&#x0123;`
10261026
buffer.push(c);
10271027
continue;
10281028
}
10291029
} else if let Some(c) = decimal.parse::<u32>().ok().and_then(char::from_u32)
10301030
{
1031-
// &#0123;
1031+
// `&#0123;`
10321032
buffer.push(c);
10331033
continue;
10341034
}
10351035
} else if let Some(c) = XML_ENTITIES.get(word) {
1036-
// &quote;
1036+
// e.g. `&quote;`, `&amp;`
10371037
buffer.push(*c);
10381038
continue;
10391039
}
1040-
// fallback
1040+
// Fallback
10411041
buffer.push('&');
10421042
buffer.push_str(word);
10431043
buffer.push(';');

0 commit comments

Comments
 (0)