h2oai / h2oai/wave

Render newlines and multiple spaces in tables

Open
#2,376 0 comments 0 reactions 0 assignees View on GitHub
feature ui
Dominant language
Python
Stars
4.3k
Forks
371
Avg merge
26d 1h
Merged PRs (30d)
1

Description

#### Is your feature request related to a problem? Please describe

I am facing the issue that I either need to use markdown or all newlines are converted to spaces and all multiple spaces are squashed to a single space when using ui.table.

This is especially an issue when displaying text from common datasets for NLP.

I am aware that markdown doesn't respect single newlines and treats them as space. But that behaviour isn't exactly common for all texts. So, I need a second option to render the raw text. Currently, wave doesn't give that option, as it also does it's own transformation of the data which makes e.g. html code unreadable. Is there any "raw text" mode that respects newlines, tabs and multiple spaces?

See my two example below:

Print from console:
![image](https://github.com/user-attachments/assets/c9a3927f-52bc-4dde-a17b-b7a2ab1ccbed)

![image](https://github.com/user-attachments/assets/d1714311-54c8-49cf-a974-aaac81ccc673)

Render with markdown=None:
![Bildschirmfoto vom 2024-07-31 13-13-25](https://github.com/user-attachments/assets/422a34d5-664b-46f1-8c83-abdd53c8f589)

Render as markdown:
![image](https://github.com/user-attachments/assets/23bae350-0335-4a44-9ae4-a0491cff8319)

#### Describe the solution you'd like

A "raw text" mode that respects newlines, tabs and multiple spaces to render tables.

#### Describe alternatives you've considered

None

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.