Search code examples
smalltalkaida

Carriage returns in WebNonHTMLResource


I create the following WebElement:

WebNonHTMLResource forText: ('This is', Character cr asString, 'a test')

However, when this is displayed in the browser, the text will look like this:

This is a test

The carriage return has not been taken into account.


Solution

  • If you put a cariage return into a HTML, it won't be displayed as a newline. You need to add a page break tag instead:

    'This is<br>a test'