From c51aa0a9a5379ef39551f755c1dce867e38de1c8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 13 May 2023 23:59:54 +0200 Subject: html unescape apos --- src/NetUtils.cpp | 5 ++++- src/QuickMedia.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/NetUtils.cpp b/src/NetUtils.cpp index 70f2f32..d99a4b7 100644 --- a/src/NetUtils.cpp +++ b/src/NetUtils.cpp @@ -8,6 +8,8 @@ #include #include +// TODO: Add all html sequences: https://html.spec.whatwg.org/multipage/named-characters.html + namespace QuickMedia { struct HtmlEscapeSequence { char unescape_char; @@ -70,8 +72,9 @@ namespace QuickMedia { html_unescape_sequence_numbers(str); // TODO: Use string find and find & and ; instead of string_replace_all - const std::array unescape_sequences = { + const std::array unescape_sequences = { HtmlUnescapeSequence { """, "\"" }, + HtmlUnescapeSequence { "'", "'" }, HtmlUnescapeSequence { "<", "<" }, HtmlUnescapeSequence { ">", ">" }, HtmlUnescapeSequence { "—", "—" }, diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 5b7a4a6..b38275d 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1655,7 +1655,7 @@ namespace QuickMedia { if(!youtube_url_extract_id(video_url, video_id)) { std::string err_msg = "Failed to extract id of youtube url "; err_msg += video_url; - err_msg + ", video wont be saved in recommendations"; + err_msg += ", video wont be saved in recommendations"; show_notification("QuickMedia", err_msg.c_str(), Urgency::LOW); return; } -- cgit v1.2.3