Skip to content

Improve HTML tag input #11622

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
3 tasks done
shuojie819 opened this issue Jun 2, 2024 · 12 comments
Closed
3 tasks done

Improve HTML tag input #11622

shuojie819 opened this issue Jun 2, 2024 · 12 comments
Assignees
Milestone

Comments

@shuojie819
Copy link

shuojie819 commented Jun 2, 2024

<u><sub>…… 输入异常

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

html 标签会被转换(不需要结束标签),输入后就会被转换,会影响到 输入、粘贴……,会变成乱码……
影响到的标签:<b>、<sub>、<sup>……
对了<br /> 也会被转换

演示视频:
PixPin_2024-06-02_11-54-43
演示附加视频:
PixPin_2024-06-02_11-56-29

Expected result

正常显示,感觉是个BUG,Typora那样才是正常的。

  • 需要结束标签才会转换。(正常输入、粘贴)
  • 在上条的基础上添加转换开关。

Screenshot or screen recording presentation

No response

Version environment

- Version: v3.0.16、v3.0.17-dev2
- Operating System: Windows 24H2
- Browser (if used):

Log file

More information

No response

@TCOTC
Copy link
Contributor

TCOTC commented Jun 2, 2024

相关:#11156

@88250
Copy link
Member

88250 commented Jun 2, 2024

需要结束标签才会转换。(正常输入、粘贴)

不需要的,只有起始标签就进行转换了,你可以试下其他的 Markdown 解析渲染器,比如 GitHub Issue 的。

<sup>foo

渲染为:

foo

在上条的基础上添加转换开关

这个不考虑添加开关了,感谢反馈。

@88250 88250 closed this as completed Jun 2, 2024
@shuojie819
Copy link
Author

shuojie819 commented Jun 2, 2024

需要结束标签才会转换。(正常输入、粘贴)

不需要的,只有起始标签就进行转换了,你可以试下其他的 Markdown 解析渲染器,比如 GitHub Issue 的。

<sup>foo

渲染为:

foo

在上条的基础上添加转换开关

这个不考虑添加开关了,感谢反馈。

  • 开关可以没有,但是不需要结束标签这个对我来说比较重要。(对我来说像是直接影响到了源码的编辑(源文本的编辑),这是不应该存在的,这是对源文本的入侵,我感觉……)
  • GitHub Issue是这样的,但是,他是源码呀……,本质有很大的区别。像是Typora这样的只有起始标签是不会被转义的。(obsidian那样的也是源码的)
  • 又试了 Notion、Wolai,他们直接就不处理,这样也是好的(不会入侵我的输入)。

所以,我觉得最起码要有结束标签才会被转义才是正常的。

@shuojie819
Copy link
Author

shuojie819 commented Jun 2, 2024

还有一个就是,我复制了一个HTML的实体字符表格:

  • 在思源中 “实体名称和实体编号” 直接会被转换成对应的实体字符,但是思源是一个笔记软件呀,直接转换时HTML的特性,我记笔记的话这属于入侵吧(可能用词不当(入侵),但是这就是我的感觉)。
  • 在Notion 直接就不会被转化。
  • 在 Wolai 中也是不会被转换。
  • 在语雀中也不会被转换,并且会提示是否转换。
  • Typora、obsidian,在阅读模式、预览模式下也会被转义,但是……他能直接改源码。所以我认为这俩没有可比性(不在一个条件)

在实用场景中,有些需要转换,有些不需要被转化。(结构肯定是需要转换的,内容就不一定了)语雀在粘贴文本时会弹出提示,询问是否需要转换,我认为这是一个合理的解决方式。

总之,直接转换在我看来对笔记软件来说是不应该存在的。

粘贴效果

@TCOTC
Copy link
Contributor

TCOTC commented Jun 2, 2024

@shuojie819
Copy link
Author

再加一个解析问题:(乱码)
recording

@TCOTC
Copy link
Contributor

TCOTC commented Jun 3, 2024

确实

image

@shuojie819
Copy link
Author

确实

image

是的呀o(╥﹏╥)o,没有闭合标签,而且还会产生乱码。
我想问一下,我们在这个issues里发的信息 D 大会有邮件通知吗,能看到吗,需要@吗(不太懂,请教(^人^))

@TCOTC
Copy link
Contributor

TCOTC commented Jun 3, 2024

能看到。过一两周没回复再 @

@shuojie819
Copy link
Author

好的👌

@88250 88250 self-assigned this Jun 5, 2024
@88250 88250 changed the title <u>、<sub>…… 输入异常 Copy code containing HTML tags exception Jun 5, 2024
@88250 88250 added the Bug label Jun 5, 2024
@88250 88250 added this to the 3.1.0 milestone Jun 5, 2024
@88250
Copy link
Member

88250 commented Jun 5, 2024

复制包含 HTML 标签的代码异常 这个问题下个版本解决,感谢反馈。

@88250 88250 reopened this Jun 5, 2024
@88250 88250 added Enhancement and removed Bug labels Jun 5, 2024
@88250 88250 changed the title Copy code containing HTML tags exception Improve HTML tag input Jun 5, 2024
88250 added a commit to 88250/lute that referenced this issue Jun 5, 2024
@88250
Copy link
Member

88250 commented Jun 5, 2024

输入闭合的问题也可以解决了。

88250 added a commit that referenced this issue Jun 5, 2024
@88250 88250 closed this as completed Jun 5, 2024
copialot pushed a commit to copialot/siyuan that referenced this issue Aug 3, 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