Skip to content

Conversation

@LIlGG
Copy link
Member

@LIlGG LIlGG commented Dec 5, 2025

What type of PR is this?

/kind bug
/area editor
/milestone 2.22.x

What this PR does / why we need it:

在复制并粘贴上传外链图片时,在点击转存后,目前会出现图片无法被正常转换为相对链接,并且在非第一行粘贴时,会导致错误的图片插入在第一行。

此 PR 对转存的逻辑进行了修复,在转存时获取了当前编辑器中对应节点的相对位置,确保替换链接时的位置正确性。

How to test it?

  1. 复制一个外链图片。
  2. 在编辑器中任意一个位置粘贴。
  3. 点击确认转存。
  4. 查看其地址是否变为了相对地址。

Which issue(s) this PR fixes:

Fixes #7912

Does this PR introduce a user-facing change?

解决编辑器粘贴转存外链图片时无法替换链接及错误插入的问题。

Updated upload extension and utility functions to use the NodePos type for node position tracking, improving type safety and consistency. Added getLatestNodePos helper to retrieve current node positions before batch uploading external links.
@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Dec 5, 2025
@f2c-ci-robot f2c-ci-robot bot added this to the 2.22.x milestone Dec 5, 2025
@f2c-ci-robot f2c-ci-robot bot added the area/editor Issues or PRs related to the Editor label Dec 5, 2025
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lilgg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2025

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 5, 2025

Open in StackBlitz

@halo-dev/api-client

npm i https://pkg.pr.new/@halo-dev/api-client@7987

@halo-dev/components

npm i https://pkg.pr.new/@halo-dev/components@7987

@halo-dev/richtext-editor

npm i https://pkg.pr.new/@halo-dev/richtext-editor@7987

@halo-dev/ui-shared

npm i https://pkg.pr.new/@halo-dev/ui-shared@7987

@halo-dev/ui-plugin-bundler-kit

npm i https://pkg.pr.new/@halo-dev/ui-plugin-bundler-kit@7987

commit: 82a2063

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.19%. Comparing base (42c374d) to head (82a2063).
⚠️ Report is 291 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7987      +/-   ##
============================================
+ Coverage     59.55%   61.19%   +1.63%     
- Complexity     3812     3933     +121     
============================================
  Files           677      689      +12     
  Lines         23248    23507     +259     
  Branches       1500     1522      +22     
============================================
+ Hits          13846    14385     +539     
+ Misses         8764     8395     -369     
- Partials        638      727      +89     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/editor Issues or PRs related to the Editor kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

编辑器粘贴外部链接图片转存到附件库后,使用附件库的地址而非原地址

1 participant