mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibUnicode: Check word break when deciding on case-ignorable code points
This commit is contained in:
parent
12fb3ae033
commit
7827aede6f
Notes:
sideshowbarker
2024-07-18 07:57:10 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/7827aede6fd Pull-request: https://github.com/SerenityOS/serenity/pull/9054
@ -118,6 +118,10 @@ TEST_CASE(to_unicode_lowercase_special_casing_sigma)
|
||||
result = Unicode::to_unicode_lowercase_full("\u2160\u03A3"sv);
|
||||
EXPECT_EQ(result, "\u2170\u03C2");
|
||||
|
||||
// Sigma preceded by A and FULL STOP
|
||||
result = Unicode::to_unicode_lowercase_full("A.\u03A3"sv);
|
||||
EXPECT_EQ(result, "a.\u03C2");
|
||||
|
||||
// Sigma preceded by A and MONGOLIAN VOWEL SEPARATOR
|
||||
result = Unicode::to_unicode_lowercase_full("A\u180E\u03A3"sv);
|
||||
EXPECT_EQ(result, "a\u180E\u03C2");
|
||||
|
@ -63,9 +63,19 @@ static bool is_case_ignorable(UnicodeData const& unicode_data)
|
||||
case GeneralCategory::Sk:
|
||||
return true;
|
||||
default:
|
||||
// FIXME: Handle word break properties (auxiliary/WordBreakProperty.txt).
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (unicode_data.word_break_property) {
|
||||
case WordBreakProperty::MidLetter:
|
||||
case WordBreakProperty::MidNumLet:
|
||||
case WordBreakProperty::SingleQuote:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool is_final_code_point(Utf8View const& string, size_t index, size_t byte_length)
|
||||
|
Loading…
Reference in New Issue
Block a user