-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Improve database text, email, url and phone field content escaping #11255
Comments
我们选择这个方案,谢谢。 |
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
我想确认一下,转义之后 html 元素还能在数据库中生效吗?如果不能的话对数据库的展示功能影响会非常大的。 |
只有模板字段支持 HTML,文本字段不支持。
…---Original---
From: ***@***.***>
Date: Tue, May 7, 2024 13:40 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [siyuan-note/siyuan] Improve database text field content escaping(Issue #11255)
或者只能输入raw文本,对应的html元素字符都进行转义保存.这样再编辑的时候显示的文本就不会丢失了.
我们选择这个方案,谢谢。
我想确认一下,转义之后 html 元素还能在数据库中生效吗?如果不能的话对数据库的展示功能影响会非常大的。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were assigned.Message ID: ***@***.***>
|
感觉方案 1 可能更好,不会影响在文本列里使用 HTML 的用户,并且拓展性更强 |
方案一实现不了,标签不闭合的话风险很高,文本字段还是就仅作为纯文本使用。 |
88250
added a commit
that referenced
this issue
May 8, 2024
88250
changed the title
Improve database text field content escaping
Improve database text, email, url and phone field content escaping
May 8, 2024
88250
added a commit
that referenced
this issue
May 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
数据库文本单元格中HTML元素字符串的丢失 The Impact of HTML Elements in Database Text Cells and How to Handle Them
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
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
输入div后,数据库显示不正常->
能使用div控制显示效果,但是不能再编辑.再编辑的时候标签丢失了.
Version environment
Log file
no
More information
No response
The text was updated successfully, but these errors were encountered: