andyduke / styled_text_package

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.
https://pub.dev/packages/styled_text
BSD 3-Clause "New" or "Revised" License
75 stars 48 forks source link

Newline charater doesn't get converted to <br/> #18

Closed CodeSpartan closed 3 years ago

CodeSpartan commented 3 years ago

This code works fine:

test = "<b>$name</b> hit <b>someone</b> with <i>a club</i>";
test += "<br/>";
test += "Next line message";

Result: img1

But this code produces a different result:

test = "<b>$name</b> hit <b>someone</b> with <i>a club</i>";
test += "\n";
test += "Next line message";

Result: img2

The problem occurs on the latest version: 1.0.3+1

CodeSpartan commented 3 years ago

Ah, I see, it only works when newLineAsBreaks is set to true. I think it should be true by default -- why wouldn't it? Anyway, closing the issue.

andyduke commented 3 years ago

@CodeSpartan For compatibility reasons with the first versions of StyledText and to better conform to the HTML standard.