Avaiga / taipy

Turns Data and AI algorithms into production-ready web applications in no time.
https://www.taipy.io
Apache License 2.0
10.94k stars 774 forks source link

BUG-Text Visual Element does not support break lines #565

Closed AlexandreSajus closed 8 months ago

AlexandreSajus commented 11 months ago

Description I can not find a way to break lines in a text visual element I expected one of those two to work: <|{"a\nb"}|text|> <|{"a<br>b"}|text|> But unfortunately, it just shows <br> as text and ignores and hides \n

Expected behavior \n should break lines in a text visual element

Runtime environment

ashutuptiwari commented 10 months ago

Please explain this issue in greater detail and assign it to me. ASAP(3 days left for hacktobefest)

AlexandreSajus commented 10 months ago

Yeah sure:

We have a visual element to display text on a webpage. The syntax is <|{text_to_display}|text|>. The problem is it does not support break lines with \n

Here is an example, pip install taipy and then run this code:

from taipy.gui import Gui

text = "a\nb"

page = """
<|{text}|text|>
"""

Gui(page=page).run()

This displays: image

Instead of "a" then on another line "b"

ashutuptiwari commented 10 months ago

image Am i doing something wrong? I was following the INSTALLATION.md

FredLL-Avaiga commented 10 months ago

Did you execute the previous commands Ie $ cd gui

Install the DOM dependencies (once and for all)

$ cd dom $ npm i $ cd ..

Install the web app dependencies

$ npm i --omit=optional

Build the web app

$ npm run build

ashutuptiwari commented 10 months ago

yes i did image

ashutuptiwari commented 10 months ago

any feedback? @FredLL-Avaiga

FabienLelaquais commented 10 months ago

For some unknown (yet) reason, it seems that the 'resolve-cwd' module was not installed.. Can you try a npm install resolve-cwd before you re-run the build command?

Maybe it can also be due to an outdated package-lock.json, sitting next to package.json in the gui directory. You may also try to remove that file and run npm run inst then npm run build.

Please let us know if this helped.

VibhorGits commented 10 months ago

Hey @AlexandreSajus @FabienLelaquais Can I also try this as hacktoberfest is about to end.

ashutuptiwari commented 10 months ago

Yes please @VibhorGits . I'll remove my assignment.

VibhorGits commented 10 months ago

Cool. Hey @ashutuptiwari May I ask you to guide me through the problem so that I get an idea about it.

FredLL-Avaiga commented 8 months ago

Duplicate for taipy-Gui #420

AlexandreSajus commented 8 months ago

I don't think this should be closed. Text visual element still does not support break lines

FredLL-Avaiga commented 8 months ago

it should be closed mode=pre