Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: solve the problem that highlighting will prevent the keys #6387

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

LIlGG
Copy link
Member

@LIlGG LIlGG commented Jul 26, 2024

What type of PR is this?

/kind bug
/area editor
/milestone 2.18.x

What this PR does / why we need it:

此 PR 解决了使用高亮插件之后按 updown 按键被阻止的问题。

此问题的来源为 halo-sigs/richtext-editor#56 ,在此前的 PR 中为了解决设置字体大小后再次设置高亮,会导致高亮无法完全笼罩字体的问题。

但经过仔细排查,发现上述问题之前的解决方式有误,正确的原因应该是设置字体大小的 span 标签与设置高亮的 mark 标签顺序相反导致。如下所示:

image

正确的情况应该是在 span 中包裹 mark。此 PR 提升了 TextStyle 的优先级,结果如下所示:

image

How to test it?

测试对文本使用高亮功能之后按 updown 按键是否生效。
测试对在文本设置大小之后,使用高亮、删除线等样式是否正确。

Which issue(s) this PR fixes:

Fixes #6381

Does this PR introduce a user-facing change?

解决默认编辑器中对文本使用高亮会导致按键被阻止的问题

@f2c-ci-robot f2c-ci-robot bot added 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. area/editor Issues or PRs related to the Editor labels Jul 26, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from Aanko and JohnNiang July 26, 2024 07:39
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.34%. Comparing base (bc10336) to head (0554d2d).
Report is 93 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6387      +/-   ##
============================================
+ Coverage     54.51%   58.34%   +3.83%     
- Complexity     3523     3766     +243     
============================================
  Files           646      646              
  Lines         21862    21989     +127     
  Branches       1528     1546      +18     
============================================
+ Hits          11917    12829     +912     
+ Misses         9328     8538     -790     
- Partials        617      622       +5     

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

@LIlGG
Copy link
Member Author

LIlGG commented Jul 26, 2024

发现移除自定义样式后,同时也能解决 #6386 的问题

Fix #6386

Copy link

sonarcloud bot commented Jul 26, 2024

Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2024
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link

f2c-ci-robot bot commented Jul 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

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

The pull request process is described 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

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit 52feea8 into halo-dev:main Jul 29, 2024
8 checks passed
@JohnNiang
Copy link
Member

/cherrypick release-2.17

@halo-dev-bot
Copy link
Collaborator

@JohnNiang: new pull request created: #6409

In response to this:

/cherrypick release-2.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ruibaby ruibaby added this to the 2.18.0 milestone Jul 29, 2024
f2c-ci-robot bot pushed a commit that referenced this pull request Jul 29, 2024
…the keys (#6409)

This is an automated cherry-pick of #6387

/assign JohnNiang

```release-note
解决默认编辑器中对文本使用高亮会导致按键被阻止的问题
```
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/editor Issues or PRs related to the Editor kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
5 participants