mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
feat:增加对svg图片格式支持
This commit is contained in:
@@ -452,7 +452,8 @@ func (c *DocumentController) Upload() {
|
|||||||
attachment.DocumentId = docId
|
attachment.DocumentId = docId
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.EqualFold(ext, ".jpg") || strings.EqualFold(ext, ".jpeg") || strings.EqualFold(ext, ".png") || strings.EqualFold(ext, ".gif") {
|
|
||||||
|
if filetil.IsImageExt(moreFile.Filename) {
|
||||||
attachment.HttpPath = "/" + strings.Replace(strings.TrimPrefix(filePath, conf.WorkingDirectory), "\\", "/", -1)
|
attachment.HttpPath = "/" + strings.Replace(strings.TrimPrefix(filePath, conf.WorkingDirectory), "\\", "/", -1)
|
||||||
if strings.HasPrefix(attachment.HttpPath, "//") {
|
if strings.HasPrefix(attachment.HttpPath, "//") {
|
||||||
attachment.HttpPath = conf.URLForWithCdnImage(string(attachment.HttpPath[1:]))
|
attachment.HttpPath = conf.URLForWithCdnImage(string(attachment.HttpPath[1:]))
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ $(function () {
|
|||||||
toolbar: true,
|
toolbar: true,
|
||||||
placeholder: "本编辑器支持 Markdown 编辑,左边编写,右边预览。",
|
placeholder: "本编辑器支持 Markdown 编辑,左边编写,右边预览。",
|
||||||
imageUpload: true,
|
imageUpload: true,
|
||||||
imageFormats: ["jpg", "jpeg", "gif", "png", "JPG", "JPEG", "GIF", "PNG"],
|
imageFormats: ["jpg", "jpeg", "gif", "png","svg", "JPG", "JPEG", "GIF", "PNG","SVG"],
|
||||||
imageUploadURL: window.imageUploadURL,
|
imageUploadURL: window.imageUploadURL,
|
||||||
toolbarModes: "full",
|
toolbarModes: "full",
|
||||||
fileUpload: true,
|
fileUpload: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user