Skip to content

Commit

Permalink
[Markdown Widget] Don't open a command prompt when opening a link
Browse files Browse the repository at this point in the history
  • Loading branch information
JVital2013 committed Nov 21, 2023
1 parent 729fe70 commit 566f422
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src-core/common/widgets/markdown_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include "common/image/image.h"
#include <filesystem>

#if defined(_WIN32)
#include <windows.h>
#endif

namespace widgets
{
void MarkdownHelper::link_callback(ImGui::MarkdownLinkCallbackData data_)
Expand All @@ -16,7 +20,7 @@ namespace widgets
logger->info("Opening URL " + url);

#if defined(_WIN32)
system(std::string("explorer \"" + url + "\"").c_str());
ShellExecuteA(0, 0, url.c_str(), 0, 0, SW_SHOW);
#elif defined(__APPLE__)
system(std::string("open " + url).c_str());
#else
Expand Down

0 comments on commit 566f422

Please sign in to comment.