Clean up url excluded chars PR

This commit is contained in:
Kovid Goyal
2021-06-17 13:11:23 +05:30
parent df0bf74bfe
commit 6ddbda00df
4 changed files with 16 additions and 8 deletions

View File

@@ -12,11 +12,17 @@ bool is_P_category(char_type);
char_type codepoint_for_mark(combining_type m);
combining_type mark_for_codepoint(char_type c);
static inline bool
is_excluded_from_url(uint32_t ch) {
for (size_t i = 0; i < OPT(url_excluded_characters_count); i++) {
if (ch == OPT(url_excluded_characters)[i]) return true;
}
return false;
}
static inline bool
is_url_char(uint32_t ch) {
for (size_t i = 0; i < OPT(url_excluded_characters_count); i++)
if (ch == OPT(url_excluded_characters)[i]) return false;
return ch && !is_CZ_category(ch);
return ch && !is_CZ_category(ch) && !is_excluded_from_url(ch);
}
static inline bool