Output for Text should convert \n to br tags. In the case of WikiText it would probably interfere with Markdown.

Workaround:

output(/\n/.replaceAll("<br />", thetext) as WikiText)

Example:

application exampleapp

entity Bla {
	text :: Text
}

var b1 := Bla{}

define page root() {
  output(/\n/.replaceAll("<br />", b1.text) as WikiText)
  form{
  	input(b1.text)
  	submit action{} {"save"}
  }
}
Submitted by Danny Groenewegen on 28 March 2010 at 10:34

On 28 March 2010 at 10:44 Eelco Visser commented:

This should definitly not be applied automatically to WikiText. I’m not sure I see the case for Text either.


On 28 March 2010 at 11:07 Danny Groenewegen commented:

It was only suggested for output of Text here, where it seems like a reasonable default for output to an html page. If the template is rendering for a different mimetype, it shouldn’t do this conversion.

Alternatively, we could use the php solution of a built-in nl2br function to make this common operation easier.


On 28 March 2010 at 11:37 Eelco Visser commented:

I think the latter solution is better. I don’t see a general case for selectively interpreting characters as markup.


On 21 May 2011 at 18:37 Eelco Visser commented:

the nl2br can be put in the library; no need for built-in

closing this issue and tagging it ‘documentation’


On 21 May 2011 at 18:37 Eelco Visser closed this issue.

On 21 May 2011 at 18:37 Eelco Visser tagged documentation

On 21 May 2011 at 18:38 Eelco Visser tagged markdown

Log in to post comments