浏览代码

MarkdownEditor: fix image url encoding

Le Tan 3 年之前
父节点
当前提交
52d389a5e7
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      libs/vtextedit
  2. 1 1
      src/utils/contentmediautils.cpp

+ 1 - 1
libs/vtextedit

@@ -1 +1 @@
-Subproject commit 19046be7d28967c2dc9d38670f23f5566087c766
+Subproject commit f38624d8b342da710dca7b5e6efb229a99032420

+ 1 - 1
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);
             qWarning() << QString("image name conflicts when copy, renamed from (%1) to (%2)").arg(oldFileName, newFileName);
 
 
             // Update the text content.
             // 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);
             const auto encodedNewFileName = vte::TextUtils::encodeUrl(newFileName);
             auto newUrlInLink(link.m_urlInLink);
             auto newUrlInLink(link.m_urlInLink);
             newUrlInLink.replace(newUrlInLink.size() - encodedOldFileName.size(),
             newUrlInLink.replace(newUrlInLink.size() - encodedOldFileName.size(),