mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
LibUnicode: Parse numbers in number formats a bit more leniently
The parser was previously expecting number sections within a pattern to start with "#", but they may also begin with "0".
This commit is contained in:
parent
f88b4dfb58
commit
6cfd63e5bd
Notes:
sideshowbarker
2024-07-18 01:12:12 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/6cfd63e5bd6 Pull-request: https://github.com/SerenityOS/serenity/pull/10894 Reviewed-by: https://github.com/linusg ✅
@ -90,7 +90,7 @@ static void parse_number_pattern(String pattern, UnicodeLocaleData& locale_data,
|
|||||||
{ "¤"sv, "{currencyCode}"sv }, // U+00A4 Currency Sign
|
{ "¤"sv, "{currencyCode}"sv }, // U+00A4 Currency Sign
|
||||||
};
|
};
|
||||||
|
|
||||||
if (auto start_number_index = pattern.find('#'); start_number_index.has_value()) {
|
if (auto start_number_index = pattern.find_any_of("#0"sv, String::SearchDirection::Forward); start_number_index.has_value()) {
|
||||||
auto end_number_index = *start_number_index + 1;
|
auto end_number_index = *start_number_index + 1;
|
||||||
|
|
||||||
for (; end_number_index < pattern.length(); ++end_number_index) {
|
for (; end_number_index < pattern.length(); ++end_number_index) {
|
||||||
|
Loading…
Reference in New Issue
Block a user