Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 09417ba

Browse files
authored
fix: the rawType of Content was not updated when switching editors (#904)
> **Warning** > > 此 PR 的改动来自:<halo-dev/halo#3516> > 因为目前 Console 仓库已经合并到 Halo 主仓库,但主仓库的 release-2.3 分支不包含 Console,所以如果需要发布 2.3.x 的 patch 版本,依旧需要在此仓库修改。 #### What type of PR is this? /kind bug /milestone 2.3.2 #### What this PR does / why we need it: 修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。 #### Which issue(s) this PR fixes: Fixes #3512 #### Special notes for your reviewer: 测试方式: 1. 安装任意一个编辑器插件,比如:https://github.com/halo-sigs/plugin-stackedit 1. 新建文章,选择安装的编辑器。 1. 发布文章。 1. 卸载或者停止编辑器。 1. 重新编辑刚刚创建的文章,如果提示 `未找到符合 markdown 格式的编辑器,请检查是否已安装编辑器插件` 则代表正常。 #### Does this PR introduce a user-facing change? ```release-note 修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。 ```
1 parent 0cb6366 commit 09417ba

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/modules/contents/pages/SinglePageEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
4848
formState.value.page.metadata.annotations = {
4949
"content.halo.run/preferred-editor": provider.name,
5050
};
51+
formState.value.content.rawType = provider.rawType;
5152
};
5253
5354
// SinglePage form

src/modules/contents/posts/PostEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const handleChangeEditorProvider = (provider: EditorProvider) => {
4848
formState.value.post.metadata.annotations = {
4949
"content.halo.run/preferred-editor": provider.name,
5050
};
51+
formState.value.content.rawType = provider.rawType;
5152
};
5253
5354
// Post form

0 commit comments

Comments
 (0)