Skip to content

Improve heading drag conversion doc subheading level #11037

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

Closed
5kyfkr opened this issue Apr 14, 2024 · 3 comments
Closed

Improve heading drag conversion doc subheading level #11037

5kyfkr opened this issue Apr 14, 2024 · 3 comments
Assignees
Milestone

Comments

@5kyfkr
Copy link

5kyfkr commented Apr 14, 2024

标题拖拽至文档树时提升等级减少一级

In what scenarios do you need this feature?

如下图,文档内拖拽1级标题至文档树后转换成文档
image
1级标题(h1)提升成文档title,其他h2-h6也提升至h1-h5
image

Describe the optimal solution

能否提供开关选项或者修改为不提升等级?因为在markdown里面h1应该就等于title,而在html语法里才有title这一说法,为了照顾md语法的习惯感觉应该给个选项能不提升等级。
至于其他如3级标题拖到文档树,我觉得也应该可以比现在少提升一级,变为3级标题转成title,4级标题转成h2,而且这样从文档树再拖回文档里也不会比原来高了一级,现在3级标题拖进文档树再拖回原来2级标题下就变成2级标题了,如下图是从文档树拖回来后3级标题变成2级了。
image

综上,应该给个选项会好点,不用markdown的就维持现状,用markdown的减少一层等级提升。

Describe the candidate solution

No response

Other information

No response

@TCOTC
Copy link
Contributor

TCOTC commented Apr 14, 2024

我用思源的时候从来不创建一级标题,一直是从二级标题开始创建的,就是因为没法批量转换一级标题。

但现在我发现了一个问题,如果把二级标题拖拽到文档树上,二级标题下的三级标题全都变成一级标题了。

所以我倾向于这样的方案:

  • 拖拽标题到文档树后,拖拽的标题变成文档名,子标题的最高级从一级标题变为二级标题(目前子标题都是一级标题,没法批量转换为低级的标题)
  • 从文档树拖拽文档到编辑器后,拖拽的文档名转换为一级标题,子标题的最高级为二级标题(因为可以「带子标题转换」,所以维持目前的这个方案就好了)

@5kyfkr
Copy link
Author

5kyfkr commented Apr 14, 2024

  • 拖拽标题到文档树后,拖拽的标题变成文档名,子标题的最高级从一级标题变为二级标题(目前子标题都是一级标题,没法批量转换为低级的标题)

这个就是我希望的方案

  • 从文档树拖拽文档到编辑器后,拖拽的文档名转换为一级标题,子标题的最高级为二级标题(因为可以「带子标题转换」,所以维持目前的这个方案就好了)

这个可以不改维持现状,问题不大

@88250 88250 self-assigned this Apr 15, 2024
@88250 88250 added this to the 3.0.10 milestone Apr 15, 2024
@88250 88250 changed the title 标题拖拽至文档树时提升等级减少一级 Improve heading drag conversion doc subheading level Apr 15, 2024
@88250
Copy link
Member

88250 commented Apr 15, 2024

很有道理,稍后改进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants