From 52d389a5e7df71a14a32444c4b743890c3b987a7 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Mon, 7 Mar 2022 20:24:09 +0800 Subject: [PATCH] MarkdownEditor: fix image url encoding --- libs/vtextedit | 2 +- src/utils/contentmediautils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vtextedit b/libs/vtextedit index 19046be7..f38624d8 160000 --- a/libs/vtextedit +++ b/libs/vtextedit @@ -1 +1 @@ -Subproject commit 19046be7d28967c2dc9d38670f23f5566087c766 +Subproject commit f38624d8b342da710dca7b5e6efb229a99032420 diff --git a/src/utils/contentmediautils.cpp b/src/utils/contentmediautils.cpp index ffe175ba..ddccdc85 100644 --- a/src/utils/contentmediautils.cpp +++ b/src/utils/contentmediautils.cpp @@ -110,7 +110,7 @@ void ContentMediaUtils::copyMarkdownMediaFiles(const QString &p_content, qWarning() << QString("image name conflicts when copy, renamed from (%1) to (%2)").arg(oldFileName, newFileName); // Update the text content. - const auto encodedOldFileName = vte::TextUtils::encodeUrl(oldFileName); + const auto encodedOldFileName = PathUtils::fileName(link.m_urlInLink); const auto encodedNewFileName = vte::TextUtils::encodeUrl(newFileName); auto newUrlInLink(link.m_urlInLink); newUrlInLink.replace(newUrlInLink.size() - encodedOldFileName.size(),