Newb formatting question

Newb formatting question

by Mustafa Hajjar -
Number of replies: 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

Average of ratings: -
In reply to Mustafa Hajjar

Re: Newb formatting question

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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).
Average of ratings: Useful (1)
In reply to Davo Smith

Re: Newb formatting question

by Mustafa Hajjar -

Thanks Davo, that did the trick.  I reviewed this in the Templates doc but my eyes didn't distinguish the third bracket smile

Mustafa