-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
refactor: editor code block to be extensible by plugins #6428
refactor: editor code block to be extensible by plugins #6428
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6428 +/- ##
============================================
+ Coverage 58.18% 58.22% +0.04%
- Complexity 3774 3775 +1
============================================
Files 651 651
Lines 22125 22128 +3
Branches 1538 1538
============================================
+ Hits 12873 12885 +12
+ Misses 8641 8634 -7
+ Partials 611 609 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ping @halo-dev/sig-halo-console
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
ui/packages/editor/src/extensions/code-block/CodeBlockViewRenderer.vue
Outdated
Show resolved
Hide resolved
…/editor-code-block
有冲突需要解决一下 |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ruibaby 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 |
What type of PR is this?
/kind improvement
/area editor
/area ui
What this PR does / why we need it:
此 PR 重构了默认编辑器中代码块的相关代码,使编辑器能够被插件扩展。这样做的优点是当用户使用例如 highlightjs 这类的高亮插件时,可以保证在 Console 端选择的语言及主题可以在主题端完美适配。
具体做了以下几处重构:
Select
组件,使得选择语言或主题更加方便。建议在此 PR 合并之后,由 Halo 默认提供一个高亮插件作为预设插件,这样可以用于解决原有功能升级之后丢失的问题。
How to test it?
测试是否会改变已有代码块的语言等。
测试使用第三方插件之后,是否具有高亮。
设置高亮语言后,保存并刷新,查看高亮语言是否存在。主题同理。
查看主题端是否能够正常渲染。
Does this PR introduce a user-facing change?