-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
windows上代码块里复制的代码的换行符不是\r\n #10596
Comments
抱歉,这个不支持,编辑器引擎 Lute 在词法分析阶段会统一将 \r\n 识别为 \n。 |
@88250 @Vanessa219 分析时将\r\n和\n都识别为 \n, 没问题 |
Lute 词法分析的时候替换的。 |
在前端复制的时候,还要调用lute来替换? 复制一次解析一次??? |
是的。 |
@88250 @Vanessa219 我看代码了,纯文本可以在lute处理后进行replace, 如下图 代码块就是纯文本,意味着也可以替换换行符 |
只是处理复制出来的地方的话应该可以的。 |
对的,我的意思就是"复制出来", 而不是粘贴进去 @88250 @Vanessa219 |
但是你上面说的这一点感觉有风险,如果本来就是 \n 怎么处理? |
@88250 粘贴到代码块时,\r\n不就会被替换成\n了吗 ? 那复制时,对于 思源来说就已经分不清\n原来是\n还是\r\n了呀 |
不需要 r 怎么办哦
…---原始邮件---
发件人: ***@***.***>
发送时间: 2024年3月29日(周五) 凌晨0:29
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [siyuan-note/siyuan] windows上代码块里复制的代码的换行符不是\r\n (Issue #10596)
@88250 粘贴到代码块时,\r\n不就会被替换成\n了吗 ? 那复制时,对于 思源来说就已经分不清\n原来是\n还是\r\n了呀
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@88250 在设置里增加个2选项: 类似git 的crlf选项 |
能用插件实现吗?
…---原始邮件---
发件人: ***@***.***>
发送时间: 2024年3月29日(周五) 凌晨1:28
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [siyuan-note/siyuan] windows上代码块里复制的代码的换行符不是\r\n (Issue #10596)
@88250 在设置里增加个选项: 使用哪种换行符? \n 或\r\n
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@88250 我觉得这种基础的功能应该由思源来实现, 插件实现的话,一没copy event,二是即便有,插件的copy事件和思源的copy事件可能会冲突 |
粘贴输入部分估计是改不了了,目前只能考虑复制输出的部分用插件。 |
@88250 为什么改不了? |
Lute 改这部分难度有点大,你有空的话可以试试。 |
@88250 没时间研究lute |
先建个 issue,后面评估看看 88250/lute#204 |
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
我的代码块里有个window路径,双击选中整行之后粘贴到explorer.exe地址栏里提示找不到路径,
经过研究发现原因是其换行符是\n而不是window换行符\r\n
比如:
代码块里有一行内容为
C:\Windows\System32
三击选中并复制整行
验证代码:
powershell
Expected result
期望换行符根据平台不同进行设置
Screenshot or screen recording presentation
No response
Version environment
Log file
`
More information
No response
The text was updated successfully, but these errors were encountered: