halo/ui/packages/editor
Takagi 52feea8553
fix: solve the problem that highlighting will prevent the keys (#6387)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.18.x

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

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

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

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

<img width="1019" alt="image" src="https://github.com/user-attachments/assets/90c0926e-caab-40b6-91ae-97c075ef7225">

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

<img width="1022" alt="image" src="https://github.com/user-attachments/assets/e5e61d54-defd-493b-818c-c09faf55a7c1">

#### How to test it?

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

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

Fixes #6381 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中对文本使用高亮会导致按键被阻止的问题
```
2024-07-29 12:57:54 +00:00
..
docs fix: resolving the issue of the draggable extension not working in the editor (#5570) 2024-03-27 04:26:06 +00:00
src fix: solve the problem that highlighting will prevent the keys (#6387) 2024-07-29 12:57:54 +00:00
.eslintrc.cjs Move folder console to ui 2024-02-02 22:22:51 +08:00
.gitignore Move folder console to ui 2024-02-02 22:22:51 +08:00
.release-it.json Move folder console to ui 2024-02-02 22:22:51 +08:00
env.d.ts Move folder console to ui 2024-02-02 22:22:51 +08:00
index.html Move folder console to ui 2024-02-02 22:22:51 +08:00
package.json chore: bump tiptap version to 2.5.7 (#6403) 2024-07-29 10:11:53 +00:00
postcss.config.js Move folder console to ui 2024-02-02 22:22:51 +08:00
prettier.config.js chore: bump vite to 5.x (#5920) 2024-05-16 06:18:36 +00:00
tailwind.config.js Move folder console to ui 2024-02-02 22:22:51 +08:00
tsconfig.app.json Move folder console to ui 2024-02-02 22:22:51 +08:00
tsconfig.json Move folder console to ui 2024-02-02 22:22:51 +08:00
tsconfig.node.json Move folder console to ui 2024-02-02 22:22:51 +08:00
tsconfig.vitest.json Move folder console to ui 2024-02-02 22:22:51 +08:00
vite.config.ts chore: organize and fix imports (#6152) 2024-06-26 10:42:50 +00:00
vite.lib.config.ts Move folder console to ui 2024-02-02 22:22:51 +08:00