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
Improve Paste
and Paste as plain text
#8289
Comments
testing.txt |
我的意思是说先粘贴为”转义文本“,再粘贴为”纯文本“,或者是直接从聊天软件中复制粘贴这段,你可以先将txt中内容发给你的一个好友,然后将消息复制粘贴到思源。 这个问题导致了从gpt发过来的信息中出现了上面的序列,也无法正确渲染。 |
我的意思就是,先粘贴为”转义文本“,再粘贴为”纯文本“,不能复现你的结果。 不过从QQ发送的信息里复制倒是能复现,我猜测是QQ自带了一些转义字符。 但是从QQ发送的信息里复制,先粘贴为”转义文本“,再粘贴为”纯文本“,也能恢复正常。 |
错了,我刚刚发现,先粘贴为”转义文本“,再“直接粘贴”才不会出现问题,粘贴为“纯文本”确实会出现。 |
是的,有时候直接粘贴为"纯文本"也会出现,txt中的文字是规范的latex或者markdown语法,按理说应该先渲染公式。 |
不过,我认为对粘贴纯文本的处理是合理的,这不是错误,因为纯文本大概不包含数学公式,$会被过滤掉,这是有意为之。 粘贴以下这个例子足以说明。
|
比如将上面的话翻译成简体中文,出于这个问题,它直接截断了 |
这个需要去检查一下chatgpt的返回,因为它不一定就是写正确的…… |
当然其实我也不认为这个复制粘贴是一个错误,因为要平衡好各种类型的文本是一种比较困难的事情,如果是化学工作者它可能下标使用比较多,他可能希望 "_" 有最高的优先级 。因为我是数学工作者我数学公式用得就比较多,我”$“符号用得比较多,因此是否可以有一个可设置符号优先级,或者可以选择屏蔽掉某些符号的作用。比如,此处我希望屏蔽"^"符号。 |
分析了下目前情况: 对于
对于上述例子中截断解析的问题也是由于这个原因造成的,内容中带有 总的来说,对于 粘贴为纯文本 的设计意图是将行级元素内容提取,将这些内容作为普通文本插入,实现上没有考虑到内容自身需要转义以避免后续解析出现问题。 这个稍后我们会进一步确认,感谢两位反馈。 |
Paste
and Paste As Plain Text
Paste
and Paste as plain text
v2.8.9-dev1 做了改进,各位有空的话帮忙测试,谢谢。 |
感谢D大的回复,后续版本都会参与测试。 |
Is there an existing issue for this?
Can the issue be reproduced with the default theme (daylight/midnight)?
Could the issue be due to extensions?
Describe the problem
在2.8.6及以后的版本中,当复制文本时,文本中出现$^$^子序列,比如 下面这段话:
The kernel is not trivial. Let$d$ be the smallest positive integer in the kernel. Then $d$ is called the period of $a$ . If $m$ is an integer such that $a^m=e$ then $m=d s$ for some integer $s$ . We observe that the elements $e, a, \ldots, a^{d-1}$ are distinct. Indeed, if $a^r=a^s$ with $0 \leqq r, s \leqq d-1$ , and say $r \leqq s$ , then $a^{s-r}=$ $e$ . Since $0 \leqq s-r<d$ we must have $s-r=0$ . The cyclic subgroup generated by $a$ has order $d$ .
如果将这段话从QQ或者其他聊天软件中粘贴,在Siyuan中会变成:
如果从GitHub上面直接复制粘贴为"文本",则没什么问题,但是如果先复制为"转义文本",再复制为"纯文本",也会出现问题:
但我个人认为无论是直接复制粘贴,还是先粘贴成转义文本再粘贴为纯文本,都应该是:
其实这不是一个很大的问题,但是使用AI时也会涉及到这个“复制粘贴”问题,比如我将上面那句话使用AI翻译:
会出现和上面类似的错误。
Expected result
希望可以自定义符号的优先级或者自定义屏蔽某些符号在文本中的作用(比如上标我一般是直接ctrl + h,从来没用过^,那么我希望可以屏蔽这个符号对于文本的作用)。
或者直接改进这个“复制粘贴”本身。
Screenshot or screen recording presentation
No response
Version environment
Log file
siyuan.log
More information
No response
The text was updated successfully, but these errors were encountered: