Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-11-24 23:17:09 +08:00
commit 3a8aa2cd25
8 changed files with 45 additions and 12 deletions

View file

@ -136,7 +136,7 @@ export const addGA = () => {
};
/*eslint-enable */
gtag("js", new Date());
gtag("config", "G-L7WEXVQCR9");
gtag("config", "G-L7WEXVQCR9", {send_page_view: false});
const para = {
version: Constants.SIYUAN_VERSION,
container: window.siyuan.config.system.container,

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/css v0.1.2
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798
github.com/88250/lute v1.7.5-0.20221121030110-f8a90733f61e
github.com/88250/lute v1.7.5-0.20221124044153-d802c1b13ae6
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732

View file

@ -17,12 +17,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798 h1:sR/s/Y9wyl79ZRCUERwLPo9zqaB3KhNRodCMTJ4ozEU=
github.com/88250/gulu v1.2.3-0.20221117052724-cd06804db798/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20221119034547-90a028e199cf h1:tf2NBNicQxhMFe0C3MLV1Hx6JMIflWOPxmvxksGil0o=
github.com/88250/lute v1.7.5-0.20221119034547-90a028e199cf/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221120152609-4d119fdfc7fc h1:Tixt1k0Ct6VZVTvvhBvRXWMdWi00pEJZXHgXGcSv/+o=
github.com/88250/lute v1.7.5-0.20221120152609-4d119fdfc7fc/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221121030110-f8a90733f61e h1:FwSZLlestq5vm36Y8T3wyhM/Q0cP3FRSx6z1UKfdZbs=
github.com/88250/lute v1.7.5-0.20221121030110-f8a90733f61e/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221124044153-d802c1b13ae6 h1:bhWVdt7x4ejTrMdHOPO6x63YlPLKrBVjr5YcA1icMzw=
github.com/88250/lute v1.7.5-0.20221124044153-d802c1b13ae6/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -450,6 +450,7 @@ func parseStdMd(markdown []byte) (ret *parse.Tree) {
luteEngine.SetSetext(false)
luteEngine.SetYamlFrontMatter(false)
luteEngine.SetLinkRef(false)
luteEngine.SetImgPathAllowSpace(true)
ret = parse.Parse("", markdown, luteEngine.ParseOptions)
genTreeID(ret)
return

View file

@ -518,7 +518,14 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
return ast.WalkContinue
}
if !util.IsRelativePath(dest) || "" == dest {
dest = strings.ReplaceAll(dest, "%20", " ")
dest = strings.ReplaceAll(dest, "%5C", "/")
n.Tokens = []byte(dest)
if !util.IsRelativePath(dest) {
return ast.WalkContinue
}
dest = filepath.ToSlash(dest)
if "" == dest {
return ast.WalkContinue
}
@ -611,10 +618,12 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
return ast.WalkContinue
}
dest = strings.ReplaceAll(dest, "%20", " ")
dest = strings.ReplaceAll(dest, "%5C", "/")
n.Tokens = []byte(dest)
if !util.IsRelativePath(dest) {
return ast.WalkContinue
}
dest = filepath.ToSlash(dest)
if "" == dest {
return ast.WalkContinue

View file

@ -314,6 +314,12 @@ func SetSyncProviderS3(s3 *conf.S3) (err error) {
syncLock.Lock()
defer syncLock.Unlock()
s3.Endpoint = strings.TrimSpace(s3.Endpoint)
s3.AccessKey = strings.TrimSpace(s3.AccessKey)
s3.SecretKey = strings.TrimSpace(s3.SecretKey)
s3.Bucket = strings.TrimSpace(s3.Bucket)
s3.Region = strings.TrimSpace(s3.Region)
Conf.Sync.S3 = s3
Conf.Save()
return
@ -323,6 +329,10 @@ func SetSyncProviderWebDAV(webdav *conf.WebDAV) (err error) {
syncLock.Lock()
defer syncLock.Unlock()
webdav.Endpoint = strings.TrimSpace(webdav.Endpoint)
webdav.Username = strings.TrimSpace(webdav.Username)
webdav.Password = strings.TrimSpace(webdav.Password)
Conf.Sync.WebDAV = webdav
Conf.Save()
return

View file

@ -124,6 +124,23 @@ func IsCorruptedSYData(data []byte) bool {
func FilterUploadFileName(name string) string {
ret := FilterFileName(name)
// 插入资源文件时去除 `[`、`(` 等符号 https://github.com/siyuan-note/siyuan/issues/6708
ret = strings.ReplaceAll(ret, "~", "")
//ret = strings.ReplaceAll(ret, "_", "") // 插入资源文件时允许下划线 https://github.com/siyuan-note/siyuan/issues/3534
ret = strings.ReplaceAll(ret, "[", "")
ret = strings.ReplaceAll(ret, "]", "")
ret = strings.ReplaceAll(ret, "(", "")
ret = strings.ReplaceAll(ret, ")", "")
ret = strings.ReplaceAll(ret, "!", "")
ret = strings.ReplaceAll(ret, "`", "")
ret = strings.ReplaceAll(ret, "&", "")
ret = strings.ReplaceAll(ret, "{", "")
ret = strings.ReplaceAll(ret, "}", "")
ret = strings.ReplaceAll(ret, "=", "")
ret = strings.ReplaceAll(ret, "#", "")
ret = strings.ReplaceAll(ret, "%", "")
ret = strings.ReplaceAll(ret, "$", "")
return ret
}