Label don't break line with \n or < br > even with html enabled

Hi, friends.
i don’t know if it is a bug or if I am just so stupid not to see where the problem but I tried in 2 different smartphones and got the same result. If someone can help me I will be very grateful. I am 2 hours trying and can’t make it works.
What I want is to take the content I get from a dictionary and show it in a label, breaking line at some points (where I use < br > or \n.

This is the block being used:

And this is the result I am getting:


PS: The label with orange background has the content of global cardapioinfantil, and the other is LabelCardapioInfantil

Did you set this label HTML format enable? If not just tick it and try

If you do, you will need to replace any \n with <br> to get line returns at those points

Ah, we do not have the HTMLContent block in Kodular ?
In which case, untick the HTMLFormat box, and use \n everywhere

1 Like

Yes, that’s missing and should be there (like with all other builders).

1 Like

Yes, I did:
image

HTMLFormat is enbabled, you can see in the screenshot that I use < br > tag in the first time the label is set and id doesn’t appear in the label, what proves that html is enabled (otherwise it would be appearing at screen) but still don’t break line.

I will try to disable HTML Format from Design but this wouldn’t solve my problem because I will need to use html tags in this label

This will work in AppInventor and Kodular - should - (HTMLFormat unticked)

image

This will NOT work in AppInventor and Kodular (HTMLFormat ticked)

image

This will work in Appinventor, because AppInventor has the HTMLContent block (HTMLFormat ticked)

image

1 Like

Without \n in the blocks I can now break line. I never imagined that could be a problem using \n with html enabled. thanks for the information.

Does this mean I can use HTML tags only in the Design, not inside the blocks?

May be this also can be used without considering HTML…

image

2 Likes

But @almeidapablo wants to apply html tags to each element then build a label with it

@Still-learning your approach might be the way to do it though :slight_smile:

1 Like

The problem is that I want to use some html tags like font size, font color and font face.
May be I could acomplish the same result using dynamic labels and setting each label as a different font size, font face and font label? I am not very used to dynamic components but I think this might work, even if it will need a lot more blocks but I can’t see another solution.

Looking like this?, sorry if i am misunderstand

Like so? ( I have only bolded each item, but you should get the idea) HTMLFormat is ticked.

1 Like

you can bring out easily by using the block called set properties in dynamic compound extension

image

All underlinerd words are keys and corresponding answers are its values…

image

very, simple with Dynamic comp extension

1 Like

For font size and color you can create a procedure


Result

1 Like

I tried the idea of using procedure and add item to list to get this done but I was still getting some bugs related to html not working so I decided to use dynamic labels to get this done without losing much more time. With dynamic labels everything worked perfectly.

If someone else has this problem in the future, I believe it can be done using TimAi2 and Dora tips if you have the patience to work on it.

1 Like