Skip to content
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

希望加粗功能可以改进 #261

Closed
stillcalm opened this issue Jul 5, 2022 · 3 comments
Closed

希望加粗功能可以改进 #261

stillcalm opened this issue Jul 5, 2022 · 3 comments

Comments

@stillcalm
Copy link

stillcalm commented Jul 5, 2022

在没有选中任何内容的情况下
加粗能匹配到附近文字
而不是这样
image

@lyngai
Copy link
Collaborator

lyngai commented Jul 5, 2022

感谢建议,匹配到附近,这个概念非常模糊。附近指的是光标前面还是后面呢?这个是无法预测的。


目前可以优化的点是触发加粗后,选中默认的占位文本。

@stillcalm
Copy link
Author

好的,谢谢解答。

@sunsonliu
Copy link
Collaborator

已提交到dev分支,做了以下优化:
没有选中内容的情况下

  • 点击加粗、斜体、上下标、字号、颜色等按钮时,会尝试选中光标所在位置附近的单词
  • 点击标题、列表、引用按钮时,会选中光标所在行

标题切换优化:
有选中内容时点击标题按钮,如果所选内容里包含标题语法,则判断当前标题级别是否符合目标标题级别,如果符合,则清除标题语法,否则将当前标题级别改成目标级别。

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