Port click on URL code to C

This commit is contained in:
Kovid Goyal
2017-09-14 20:03:28 +05:30
parent ed3427f349
commit 464291bbb1
7 changed files with 60 additions and 30 deletions

View File

@@ -30,3 +30,12 @@ normalize(uint32_t ch, uint32_t cc1, uint32_t cc2) {
if (ans && cc2) ans = uc_composition(ans, cc2);
return ans;
}
static inline bool
can_strip_from_end_of_url(uint32_t ch) {
// remove trailing punctuation
return (
(uc_is_general_category_withtable(ch, UC_CATEGORY_MASK_P) && ch != '/') ||
ch == '>'
) ? true : false;
}