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

ui.table with markdown doesn't render text html.escape() #2392

Open
pascal-pfeiffer opened this issue Sep 20, 2024 · 1 comment
Open

ui.table with markdown doesn't render text html.escape() #2392

pascal-pfeiffer opened this issue Sep 20, 2024 · 1 comment
Labels
bug Bug in code ui Related to UI

Comments

@pascal-pfeiffer
Copy link

Wave SDK Version, OS

Wave 1.5.1

Actual behavior

Given I have some html text that I want to display in ui.table, together with other markdown text in the the same column. I want to prevent code injection attacks, so I am using html.escape() on all text first.

When rendering in Wave, some escaped html characters are not visualized correctly:

escaped csv

Name: Content, dtype: object
0                                         <ul>\r
1                                         <ul>\r
2        <li><label for="usermail&quo...
3        <li><label for="usermail&quo...
Name: Content, dtype: object

so, somehow <ul> gets visualized correctly while <li><label for="usermail">Email</label> is rendered with escaped strings &lt;.

image

Expected behavior

Render escaped markdown in ui.table()

Potential improvement

Add a flag to force safe rendering in ui.table() to reduce the risk of code injection.

@pascal-pfeiffer pascal-pfeiffer added the bug Bug in code label Sep 20, 2024
@pascal-pfeiffer
Copy link
Author

This gets even more complex when combined with code fields. In this case, I would not want to escape anything inside the code blocks, but escape anything outside of them to prevent code injection.

@mturoci mturoci added the ui Related to UI label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code ui Related to UI
Projects
None yet
Development

No branches or pull requests

2 participants