diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 14e1ede3f..6aef9f34f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -14,10 +14,10 @@ Install pnpm: `npm install -g pnpm@10.12.1` Set the Electron mirror environment variable and install Electron: -* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v36.4.0 -D` +* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v36.5.0 -D` * Windows: * `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/` - * `pnpm install electron@v36.4.0 -D` + * `pnpm install electron@v36.5.0 -D` NPM mirror: @@ -27,7 +27,7 @@ NPM mirror: Enter the app folder and execute: -* `pnpm install electron@v36.4.0 -D` +* `pnpm install electron@v36.5.0 -D` * `pnpm run dev` * `pnpm run start` diff --git a/.github/CONTRIBUTING_zh_CN.md b/.github/CONTRIBUTING_zh_CN.md index 940253da7..7d019dfed 100644 --- a/.github/CONTRIBUTING_zh_CN.md +++ b/.github/CONTRIBUTING_zh_CN.md @@ -14,10 +14,10 @@ 设置 Electron 镜像环境变量并安装 Electron: -* macOS/Linux:`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v36.4.0 -D` +* macOS/Linux:`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v36.5.0 -D` * Windows: * `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/` - * `pnpm install electron@v36.4.0 -D` + * `pnpm install electron@v36.5.0 -D` NPM 镜像: @@ -27,7 +27,7 @@ NPM 镜像: 进入 app 文件夹执行: -* `pnpm install electron@v36.4.0 -D` +* `pnpm install electron@v36.5.0 -D` * `pnpm run dev` * `pnpm run start` diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml index 58ff6b8a8..80e29e3f8 100644 --- a/app/pnpm-lock.yaml +++ b/app/pnpm-lock.yaml @@ -131,8 +131,8 @@ packages: resolution: {integrity: sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==} engines: {node: '>=12'} - '@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': - resolution: {commit: 06b29aafb7708acef8b3669835c8a7857ebc92d2, repo: https://github.com/electron/node-gyp.git, type: git} + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': + resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2} version: 10.2.0-electron.1 engines: {node: '>=12.13.0'} hasBin: true @@ -2803,7 +2803,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2': + '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2': dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.2 @@ -2840,7 +2840,7 @@ snapshots: '@electron/rebuild@3.7.0': dependencies: - '@electron/node-gyp': git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2 + '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2 '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 debug: 4.4.0 diff --git a/kernel/api/extension.go b/kernel/api/extension.go index fe24cf494..d249bb73b 100644 --- a/kernel/api/extension.go +++ b/kernel/api/extension.go @@ -62,13 +62,29 @@ func extensionCopy(c *gin.Context) { clippingSym := false symArticleHref := "" - if nil != form.Value["href"] { + hasHref := nil != form.Value["href"] + isPartClip := nil != form.Value["clipType"] && form.Value["clipType"][0] == "part" + if hasHref && !isPartClip { // 剪藏链滴帖子时直接使用 Markdown 接口的返回 // https://ld246.com/article/raw/1724850322251 symArticleHref = form.Value["href"][0] - if strings.HasPrefix(symArticleHref, "https://ld246.com/article/") || strings.HasPrefix(symArticleHref, "https://liuyun.io/article/") { - symArticleHref = strings.ReplaceAll(symArticleHref, "https://ld246.com/article/", "https://ld246.com/article/raw/") - symArticleHref = strings.ReplaceAll(symArticleHref, "https://liuyun.io/article/", "https://liuyun.io/article/raw/") + + var baseURL, originalPrefix string + if strings.HasPrefix(symArticleHref, "https://ld246.com/article/") { + baseURL = "https://ld246.com/article/raw/" + originalPrefix = "https://ld246.com/article/" + } else if strings.HasPrefix(symArticleHref, "https://liuyun.io/article/") { + baseURL = "https://liuyun.io/article/raw/" + originalPrefix = "https://liuyun.io/article/" + } + + if "" != baseURL { + articleID := strings.TrimPrefix(symArticleHref, originalPrefix) + if idx := strings.IndexAny(articleID, "/?#"); -1 != idx { + articleID = articleID[:idx] + } + + symArticleHref = baseURL + articleID clippingSym = true } } diff --git a/kernel/model/export_merge.go b/kernel/model/export_merge.go index b0058600e..7b660f26f 100644 --- a/kernel/model/export_merge.go +++ b/kernel/model/export_merge.go @@ -60,6 +60,12 @@ func mergeSubDocs(rootTree *parse.Tree) (ret *parse.Tree, err error) { break } } + + if ast.NodeParagraph == insertPoint.Type && nil == insertPoint.FirstChild { + // 删除空段落 + // Ignore the last empty paragraph block when exporting merged sub-documents https://github.com/siyuan-note/siyuan/issues/15028 + insertPoint.Unlink() + } return }