Skip to content

Markdown syntax switch no longer affects clip/paste HTML parsing #11604

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
Achuan-2 opened this issue May 31, 2024 · 18 comments
Closed

Markdown syntax switch no longer affects clip/paste HTML parsing #11604

Achuan-2 opened this issue May 31, 2024 · 18 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented May 31, 2024

In what scenarios do you need this feature?

比如直接在GitHub复制右边的内容到思源笔记👉 fRS
上标和下标,如果关闭「Markdown下标语法」和「Markdown上标语法」就无法渲染
Clip_2024-05-31_17-07-04

Describe the optimal solution

剪藏下标在关闭Markdown下标语法的时候,依然能正常渲染
剪藏下标应该默认是<sup></sup>,上标是<sub></sub>

Describe the candidate solution

No response

Other information

No response

@Achuan-2 Achuan-2 changed the title 剪藏下标无法正常渲染 剪藏上下标无法正常渲染 May 31, 2024
@88250
Copy link
Member

88250 commented May 31, 2024

这个是设计如此,要开启上下标语法才能解析。

@88250 88250 closed this as completed May 31, 2024
@Achuan-2
Copy link
Member Author

Achuan-2 commented May 31, 2024

问题是,复制样式,剪贴板查看本身就是html样式<sub><sup>,是思源给处理为了Markdown语法
并不是复制Markdown上下标语法粘贴到思源

@88250
Copy link
Member

88250 commented May 31, 2024

没有办法处理,思源内部是用 Markdown 语法解析的,如果关闭了语法开关,则无法解析。

@Achuan-2
Copy link
Member Author

Achuan-2 commented May 31, 2024

不能剪藏默认把上下标改为<sup></sup><sub></sub>吗?
现在思源也是支持直接粘贴<sup></sup><sub></sub>,解析上下标的,只要剪藏默认是把上下标转换为html标签,就可以关闭开关也能渲染了

@Achuan-2
Copy link
Member Author

Achuan-2 commented May 31, 2024

语法开关关闭后,不支持Markdown语法输入和粘贴的解析是合理的
但是关闭后连富文本的样式都不能解析的话,这个开关的意义就不大了
现在是关闭上下标语法之后,从word复制带有上下标内容,也是无法解析样式

@88250 88250 changed the title 剪藏上下标无法正常渲染 关闭 Markdown 上下标语法后剪藏上下标无法渲染 May 31, 2024
@88250
Copy link
Member

88250 commented May 31, 2024

那暂时没有办法了,等后面有空看看能不能解决吧。

@88250 88250 reopened this May 31, 2024
@Achuan-2
Copy link
Member Author

Achuan-2 commented Jun 1, 2024

目前上下标的剪藏,我觉得可以把默认的解析语法改为<sup></sup><sub></sub>,毕竟现在的默认导出上下标已经是html语法了,输入却是Markdown的^~就有问题。
但是考虑之后要添加斜体等样式的语法开关的话,
可能要对富文本的粘贴单独进行解析,而不考虑Markdown语法解析开关,这样可以在不影响粘贴富文本的情况下,关闭Markdown特定语法的输入,不知道这样能不能实现?

@88250
Copy link
Member

88250 commented Jun 1, 2024 via email

@TCOTC
Copy link
Contributor

TCOTC commented Jun 1, 2024

在不影响粘贴富文本的情况下,关闭 Markdown 特定语法的输入

这个应该是关键

@TCOTC
Copy link
Contributor

TCOTC commented Jun 30, 2024

类似的问题:#10577 (comment)

复制和剪切的已经是标签了,粘贴出来的就应该是标签,而不是 # 包裹的文本:

default.webm

@88250 88250 changed the title 关闭 Markdown 上下标语法后剪藏上下标无法渲染 关闭 Markdown 语法后剪藏/粘贴无法解析渲染相关语法 Sep 15, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Sep 15, 2024

我觉得得在发新版前搞定这个 issue ,或者实现对老用户也默认启用语法,否则对老用户影响太大了。

@88250
Copy link
Member

88250 commented Sep 15, 2024

只能先建议老用户开启语法了,一下子搞不定。

@88250 88250 self-assigned this Oct 29, 2024
@88250 88250 added this to the 3.1.11 milestone Oct 29, 2024
@Achuan-2
Copy link
Member Author

哇,现在有解决方案了吗

@88250 88250 changed the title 关闭 Markdown 语法后剪藏/粘贴无法解析渲染相关语法 Markdown syntax switch no longer affects clip/paste HTML parsing Oct 29, 2024
@88250
Copy link
Member

88250 commented Oct 29, 2024

应该可以解决了,等后面实现完麻烦测试看看。

@Achuan-2
Copy link
Member Author

应该可以解决了,等后面实现完麻烦测试看看。

好的,没问题,期待下

88250 added a commit to 88250/lute that referenced this issue Oct 29, 2024

Verified

This commit was signed with the committer’s verified signature.
88250 added a commit to 88250/lute that referenced this issue Oct 29, 2024
@88250
Copy link
Member

88250 commented Oct 29, 2024

等下个 dev 版麻烦测试。

@88250 88250 closed this as completed Oct 29, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Oct 29, 2024

试了一下剪藏和粘贴,感觉 OK 了

@Achuan-2
Copy link
Member Author

Achuan-2 commented Oct 30, 2024

测试了下,应该没问题

加粗:**foo**
斜体:*foo*
下标:foo<sub>foo</sub>
上标:foo<sup>foo</sup>
删除线:~~foo~~

PixPin_2024-10-30_09-14-36

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