Browse Source

fix dashed list2 and links

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3308/head
crueter 3 weeks ago
parent
commit
c070fcdb8f
  1. 8
      src/core/hle/service/bcat/news/builtin_news.cpp
  2. 2
      src/qt_common/discord/discord_impl.cpp

8
src/core/hle/service/bcat/news/builtin_news.cpp

@ -141,7 +141,7 @@ std::optional<std::string> DownloadReleasesJson() {
cli.set_read_timeout(10); cli.set_read_timeout(10);
httplib::Headers headers{ httplib::Headers headers{
{"User-Agent", "eden"},
{"User-Agent", "Eden"},
{"Accept", "application/vnd.github+json"}, {"Accept", "application/vnd.github+json"},
}; };
@ -192,6 +192,10 @@ std::string SanitizeMarkdown(std::string_view markdown) {
static const boost::regex list2(R"(^ \* )"); static const boost::regex list2(R"(^ \* )");
text = boost::regex_replace(text, list2, ""); text = boost::regex_replace(text, list2, "");
// what
static const boost::regex list2_dash(R"(^ - )");
text = boost::regex_replace(text, list2_dash, "");
// Convert bold/italic text into normal text // Convert bold/italic text into normal text
static const boost::regex bold(R"(\*\*(.*?)\*\*)"); static const boost::regex bold(R"(\*\*(.*?)\*\*)");
text = boost::regex_replace(text, bold, "$1"); text = boost::regex_replace(text, bold, "$1");
@ -200,7 +204,7 @@ std::string SanitizeMarkdown(std::string_view markdown) {
text = boost::regex_replace(text, italic, "$1"); text = boost::regex_replace(text, italic, "$1");
// Remove links and convert to normal text // Remove links and convert to normal text
static const boost::regex link(R"([(.*?)]\(.*\))");
static const boost::regex link(R"(\[([^\]]+)\]\([^)]*\))");
text = boost::regex_replace(text, link, "$1"); text = boost::regex_replace(text, link, "$1");
// Trim trailing whitespace/newlines // Trim trailing whitespace/newlines

2
src/qt_common/discord/discord_impl.cpp

@ -100,7 +100,7 @@ void DiscordImpl::Update() {
"https://raw.githubusercontent.com/eden-emulator/boxart/refs/heads/master/img/{}.png", "https://raw.githubusercontent.com/eden-emulator/boxart/refs/heads/master/img/{}.png",
icon_name); icon_name);
httplib::Client client(game_url);
httplib::SSLClient client(game_url);
client.set_connection_timeout(3); client.set_connection_timeout(3);
client.set_read_timeout(3); client.set_read_timeout(3);
client.set_follow_location(true); client.set_follow_location(true);

Loading…
Cancel
Save