1

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.

Cantillon
  • 1,588
  • 1
  • 12
  • 23

1 Answers1

1

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'
Janko Mivšek
  • 3,954
  • 3
  • 23
  • 29
  • Wouldn't the ' aidaContentType: 'text/plain' ' sent to WebNonHTMLResource make sure it's in text format? – Cantillon Jan 31 '13 at 13:09
  • Ok, then add 'Character lf asString' as well to your string above. In Smalltalks there is only cr used for newline while on the web you need cr and lf. Please let s know if now works. – Janko Mivšek Jan 31 '13 at 21:05
  • I tested a bit further. If I just return the WebNonHTMLResource element in the view, the cr works (even without the lf). If I add the WebNonHTMLResource to another element, the content type of the whole page is obviously still text/html. I added some html formatting (div) to make sure I can control the presentation. – Cantillon Feb 01 '13 at 13:42