halo/ui
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
..
.changeset Move folder console to ui 2024-02-02 22:22:51 +08:00
.husky Fix the problem of being unable to commit (#5362) 2024-02-18 08:00:16 +00:00
.vscode chore: add vscode settings.json (#6151) 2024-06-26 18:07:53 +08:00
console-src refactor: change the number of queried attachments in the selector modal (#6402) 2024-07-29 04:49:53 +00:00
cypress Move folder console to ui 2024-02-02 22:22:51 +08:00
docs feat: add secret select input (#6140) 2024-06-27 10:08:55 +00:00
packages fix: solve the problem that highlighting will prevent the keys (#6387) 2024-07-29 12:57:54 +00:00
public Move folder console to ui 2024-02-02 22:22:51 +08:00
src fix: enter key causing focus loss in default editor title during composition input (#6347) 2024-07-22 05:49:33 +00:00
uc-src feat: add retry mechanism for publishing posts in user center (#6406) 2024-07-29 10:13:54 +00:00
.editorconfig Move folder console to ui 2024-02-02 22:22:51 +08:00
.env.development chore: remove unnecessary env (#6022) 2024-05-30 08:31:16 +00:00
.env.production chore: remove unnecessary env (#6022) 2024-05-30 08:31:16 +00:00
.eslintrc.cjs Generate API docs and regenerate API client (#5742) 2024-04-19 02:34:07 +00:00
.gitignore Move folder console to ui 2024-02-02 22:22:51 +08:00
.gitpod.yml Move folder console to ui 2024-02-02 22:22:51 +08:00
.npmignore Move folder console to ui 2024-02-02 22:22:51 +08:00
.npmrc Move folder console to ui 2024-02-02 22:22:51 +08:00
.prettierignore Generate API docs and regenerate API client (#5742) 2024-04-19 02:34:07 +00:00
Makefile Move folder console to ui 2024-02-02 22:22:51 +08:00
OWNERS Move folder console to ui 2024-02-02 22:22:51 +08:00
README.md chore: bump pnpm version to 9 (#5953) 2024-05-21 03:24:45 +00:00
build.gradle Refactor api client using separated OpenAPI groups 2024-06-25 12:31:25 +08:00
cypress.json Move folder console to ui 2024-02-02 22:22:51 +08:00
env.d.ts feat: add support for setting an owner for posts (#6178) 2024-06-27 10:10:55 +00:00
index.html refactor: implementation of browser tab title (#5794) 2024-04-25 03:43:10 +00:00
package.json chore: bump tiptap version to 2.5.7 (#6403) 2024-07-29 10:11:53 +00:00
pnpm-lock.yaml chore: bump tiptap version to 2.5.7 (#6403) 2024-07-29 10:11:53 +00:00
pnpm-workspace.yaml Move folder console to ui 2024-02-02 22:22:51 +08:00
postcss.config.cjs chore: bump vite to 5.x (#5920) 2024-05-16 06:18:36 +00:00
prettier.config.cjs chore: bump vite to 5.x (#5920) 2024-05-16 06:18:36 +00:00
tailwind.config.cjs chore: bump vite to 5.x (#5920) 2024-05-16 06:18:36 +00:00
tsconfig.app.json chore: bump vue related packages version (#5384) 2024-02-22 03:12:07 +00:00
tsconfig.json Move folder console to ui 2024-02-02 22:22:51 +08:00
tsconfig.node.json chore: bump vite to 5.x (#5920) 2024-05-16 06:18:36 +00: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.uc.config.ts chore: organize and fix imports (#6152) 2024-06-26 10:42:50 +00:00
vitest.config.ts chore: organize and fix imports (#6152) 2024-06-26 10:42:50 +00:00

README.md

README

Halo logo

Halo 2.0 的管理端项目(原 halo-admin

GitHub release GitHub GitHub last commit GitHub Workflow Status Gitpod ready-to-code


当前仓库已经将 halo-admin 改为了 console。但对于 Halo 1.x 版本,依旧保持 halo-admin 的概念。

开发环境运行

npm install -g pnpm@9
pnpm install 
pnpm build:packages
pnpm dev

生产构建

pnpm build

状态

Repobeats analytics