diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-03 18:51:13 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-05 05:53:41 +0200 |
commit | a105630199bb4be80b3a8228a2c3e5b0c7347625 (patch) | |
tree | dbb50d356d6201085362250a2891c6ab22ae8e59 /include/NetUtils.hpp | |
parent | 3ca7ed72c2f3a046e94213a8c26d80eafde9585c (diff) |
Make url parsing better by using a list of valid tlds. Make urls blue in text
Diffstat (limited to 'include/NetUtils.hpp')
-rw-r--r-- | include/NetUtils.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/NetUtils.hpp b/include/NetUtils.hpp index 4770fb4..e719c82 100644 --- a/include/NetUtils.hpp +++ b/include/NetUtils.hpp @@ -4,8 +4,15 @@ #include <vector> namespace QuickMedia { + struct Range { + size_t start; + size_t length; + }; + void html_escape_sequences(std::string &str); void html_unescape_sequences(std::string &str); std::string url_param_encode(const std::string ¶m); - void extract_urls(const std::string &str, std::vector<std::string> &urls); + std::vector<Range> extract_urls(const std::string &str); + std::vector<std::string> ranges_get_strings(const std::string &str, const std::vector<Range> &ranges); + void convert_utf8_to_utf32_ranges(const std::string &str, std::vector<Range> &ranges); }
\ No newline at end of file |