From 964cf1a750c7f3487498c995d918c0c9c1c3e997 Mon Sep 17 00:00:00 2001 From: lealife Date: Wed, 28 Dec 2016 10:27:08 +0800 Subject: [PATCH] fix issue can't sync images on markdown notes --- app/controllers/api/ApiNoteController.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/ApiNoteController.go b/app/controllers/api/ApiNoteController.go index d251494..1c5ae85 100644 --- a/app/controllers/api/ApiNoteController.go +++ b/app/controllers/api/ApiNoteController.go @@ -166,18 +166,20 @@ func (c ApiNote) fixPostNotecontent(noteOrContent *info.ApiNote) { if file.LocalFileId != "" { LogJ(file) if !file.IsAttach { - reg, _ := regexp.Compile(`"https*://[^/]*?/api/file/getImage\?fileId=`+file.LocalFileId) + // /api/file/getImage?fileId=serverId // noteOrContent.Content = strings.Replace(noteOrContent.Content, // baseUrl + "/api/file/getImage?fileId="+file.LocalFileId, // "/api/file/getImage?fileId="+file.FileId, -1) } else { - reg, _ := regexp.Compile(`"https*://[^/]*?/api/file/getAttach\?fileId=`+file.LocalFileId) + reg, _ := regexp.Compile(`https*://[^/]*?/api/file/getAttach\?fileId=`+file.LocalFileId) Log(reg) - noteOrContent.Content = reg.ReplaceAllString(noteOrContent.Content, `"/api/file/getAttach?fileId=`+file.FileId) + noteOrContent.Content = reg.ReplaceAllString(noteOrContent.Content, `/api/file/getAttach?fileId=`+file.FileId) /* noteOrContent.Content = strings.Replace(noteOrContent.Content, baseUrl + "/api/file/getAttach?fileId="+file.LocalFileId,