aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-05-13 23:59:54 +0200
committerdec05eba <dec05eba@protonmail.com>2023-05-13 23:59:54 +0200
commitc51aa0a9a5379ef39551f755c1dce867e38de1c8 (patch)
tree0b447d1ccbff44651a98b13896d5420d25a8fdc5
parent7410b2078458a86636e92da4b6b3be1b38b56e3e (diff)
html unescape apos
-rw-r--r--src/NetUtils.cpp5
-rw-r--r--src/QuickMedia.cpp2
2 files changed, 5 insertions, 2 deletions
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 <string.h>
#include <unordered_set>
+// 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<HtmlUnescapeSequence, 6> unescape_sequences = {
+ const std::array<HtmlUnescapeSequence, 7> unescape_sequences = {
HtmlUnescapeSequence { "&quot;", "\"" },
+ HtmlUnescapeSequence { "&apos;", "'" },
HtmlUnescapeSequence { "&lt;", "<" },
HtmlUnescapeSequence { "&gt;", ">" },
HtmlUnescapeSequence { "&mdash;", "—" },
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;
}