Newb formatting question

Newb formatting question

- Mustafa Hajjar の投稿
返信数: 2

I am trying to output text with an line break to be rendered in my mustache file, the tag {{title}} can have a <br/> (i.e. 'Exercise 1<br/>Intro').  I would like to see a break rendered on the page, but instead I am getting the <br/> output in text rather than a line break.  

I tried changing the title type in the exporter to FORMAT_HTML, FORMAT_PLAIN, FORMAT_TEXT, and tinkered around with format_text and format_string() functions with no use. 

What am I doing wrong?

Thanks,

Mustafa

Mustafa Hajjar への返信

Re: Newb formatting question

- Davo Smith の投稿
画像 Core developers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers
Mustache templates clean all values by default (to prevent user-submitted data from being able to break the page layout).

If you are certain the value is safe, then you can output it without cleaning using: {{{title}}} instead of {{title}} (i.e. triple-brackets).