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: can not input title using Chinese IME in editor #4975

Merged
merged 3 commits into from
Dec 2, 2023

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Dec 2, 2023

What type of PR is this?

/kind bug
/area console
/milestone 2.12.x

What this PR does / why we need it:

修复在默认编辑器中无法使用拼音输入法输入标题的问题,此问题由 #4909 引发。

Which issue(s) this PR fixes:

Fixes #4970

Special notes for your reviewer:

在编辑器中,使用拼音输入法输入标题(heading),观察是否可以正常输入。

Does this PR introduce a user-facing change?

修复在默认编辑器中无法使用拼音输入法输入标题的问题。

Signed-off-by: Ryan Wang <i@ryanc.cc>
@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 2, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.12.x milestone Dec 2, 2023
@f2c-ci-robot f2c-ci-robot bot added the area/console Issues or PRs related to the Halo Console label Dec 2, 2023
@f2c-ci-robot f2c-ci-robot bot requested review from guqing and lan-yonghui December 2, 2023 07:07
@ruibaby
Copy link
Member Author

ruibaby commented Dec 2, 2023

/cherry-pick release-2.11

@halo-dev-bot
Copy link
Collaborator

@ruibaby: once the present PR merges, I will cherry-pick it on top of release-2.11 in a new PR and assign it to you.

In response to this:

/cherry-pick release-2.11

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.

Copy link

codecov bot commented Dec 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f5dcc62) 55.94% compared to head (d44db2a) 55.94%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #4975   +/-   ##
=========================================
  Coverage     55.94%   55.94%           
  Complexity     3034     3034           
=========================================
  Files           525      525           
  Lines         17816    17816           
  Branches       1329     1329           
=========================================
  Hits           9967     9967           
  Misses         7300     7300           
  Partials        549      549           

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

@LIlGG
Copy link
Member

LIlGG commented Dec 2, 2023

这里应该是在编辑器执行 update 更新的时候,又触发了一次 dispatch() 导致循环更新文档所致。目前我能想到最好的方式或许是使用装饰器 decorations 在一次事务中更新 id。

@LIlGG
Copy link
Member

LIlGG commented Dec 2, 2023

我尝试使用 decorations 重写了 handleGenerateTableOfContent,可以试试看是否符合要求。

@ruibaby
Copy link
Member Author

ruibaby commented Dec 2, 2023

这里应该是在编辑器执行 update 更新的时候,又触发了一次 dispatch() 导致循环更新文档所致。目前我能想到最好的方式或许是使用装饰器 decorations 在一次事务中更新 id。

如果改动不大并且不需要修改编辑器的话,你可以提个 PR。

@ruibaby
Copy link
Member Author

ruibaby commented Dec 2, 2023

我尝试使用 decorations 重写了 handleGenerateTableOfContent,可以试试看是否符合要求。

重新提交 PR 吧,到时候这个 PR 直接 Close。

@LIlGG
Copy link
Member

LIlGG commented Dec 2, 2023

重新提交 PR 吧,到时候这个 PR 直接 Close。

直接在这个 PR 上就可以,解决的是同一个问题。测试没问题描述改一下就行我感觉。

Signed-off-by: Ryan Wang <i@ryanc.cc>
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

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 2, 2023
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 Dec 2, 2023

[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 Dec 2, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 551f2ae into halo-dev:main Dec 2, 2023
4 checks passed
@halo-dev-bot
Copy link
Collaborator

@ruibaby: new pull request created: #4977

In response to this:

/cherry-pick release-2.11

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.

f2c-ci-robot bot pushed a commit that referenced this pull request Dec 7, 2023
#### What type of PR is this?

/kind bug
/area console
/milestone 2.12.x

#### What this PR does / why we need it:

在 #4975 中,使用 `decorations` 重写了 heading,但由于 `decorations` 只会给 nodeview 增加 id,因此会导致 render 后的 html 中不存在 id。
默认编辑器 heading 渲染时,自动增加 id。

#### How to test it?

使用默认编辑器编辑时,增加 Heading。保存后查看主题端对应的 heading 是否存在 id。

#### Which issue(s) this PR fixes:

Fixes #4994 

#### Does this PR introduce a user-facing change?
```release-note
解决渲染后的 Heading 中不存在 id 的问题。
```
@JohnNiang JohnNiang modified the milestones: 2.12.x, 2.12.0 Jan 7, 2024
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/console Issues or PRs related to the Halo Console 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
Development

Successfully merging this pull request may close these issues.

升级到2.11后,默认编辑器输入中文出现问题
5 participants