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

Improve database text, email, url and phone field content escaping #11255

Closed
3 tasks done
AirParty opened this issue May 5, 2024 · 5 comments
Closed
3 tasks done

Improve database text, email, url and phone field content escaping #11255

AirParty opened this issue May 5, 2024 · 5 comments
Assignees
Milestone

Comments

@AirParty
Copy link

AirParty commented May 5, 2024

数据库文本单元格中HTML元素字符串的丢失 The Impact of HTML Elements in Database Text Cells and How to Handle Them

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

1.在数据库的文本单元格中输入<div> ,然后数据库的所有数据行都会合并为一行.
2.在文本单元格中可以使用<div>内容</div>进行输入,也能显示,但是在重新编辑的时候,对应的所有html元素会被删除.
猜测是写入的字符串中html元素没有进行转义再写入.

1.If you enter "<div>" in a text cell of the database, all data rows in the database will be merged into one row.
2.You can enter "<div>content</div>" in a text cell, and it will be displayed. However, when you edit it again, all corresponding HTML elements will be deleted.
It is speculated that the HTML elements in the input string were not escaped before being written.

Expected result

现在输入的字符串和再编辑的字符串不一致.实际上导致了输入的<标签>中的文本都丢失了.
希望能明确为可以允许输入html实现自定义效果,编辑的时候显示原始文本.
或者只能输入raw文本,对应的html元素字符都进行转义保存.这样再编辑的时候显示的文本就不会丢失了.
The input string and the edited string are not consistent. This has resulted in the loss of the text within the in the input.
I hope it can be clarified whether HTML input is allowed to achieve custom effects, or if only raw text can be entered with corresponding HTML element characters being escaped.

Screenshot or screen recording presentation

image
输入div后,数据库显示不正常->
image

能使用div控制显示效果,但是不能再编辑.再编辑的时候标签丢失了.
image

Version environment

- Version: v3.0.12
- Operating System: windows
- Browser (if used):

Log file

no

More information

No response

@88250
Copy link
Member

88250 commented May 5, 2024

或者只能输入raw文本,对应的html元素字符都进行转义保存.这样再编辑的时候显示的文本就不会丢失了.

我们选择这个方案,谢谢。

@88250 88250 self-assigned this May 5, 2024
@88250 88250 changed the title 数据库文本单元格中HTML元素字符串的丢失 The Impact of HTML Elements in Database Text Cells and How to Handle Them Improve database text field content escaping May 5, 2024
@88250 88250 added this to the backlog milestone May 5, 2024
@frostime
Copy link
Contributor

frostime commented May 7, 2024

或者只能输入raw文本,对应的html元素字符都进行转义保存.这样再编辑的时候显示的文本就不会丢失了.

我们选择这个方案,谢谢。

我想确认一下,转义之后 html 元素还能在数据库中生效吗?如果不能的话对数据库的展示功能影响会非常大的。

@88250
Copy link
Member

88250 commented May 7, 2024 via email

@TCOTC
Copy link
Contributor

TCOTC commented May 7, 2024

  1. 希望能明确为可以允许输入html实现自定义效果,编辑的时候显示原始文本.

  2. 或者只能输入raw文本,对应的html元素字符都进行转义保存.这样再编辑的时候显示的文本就不会丢失了.

感觉方案 1 可能更好,不会影响在文本列里使用 HTML 的用户,并且拓展性更强

@88250 88250 modified the milestones: backlog, 3.0.14 May 7, 2024
@88250
Copy link
Member

88250 commented May 8, 2024

方案一实现不了,标签不闭合的话风险很高,文本字段还是就仅作为纯文本使用。

Vanessa219 added a commit that referenced this issue May 8, 2024
Vanessa219 added a commit that referenced this issue May 8, 2024
@88250 88250 changed the title Improve database text field content escaping Improve database text, email, url and phone field content escaping May 8, 2024
@88250 88250 closed this as completed May 8, 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

5 participants