UFM for rich text editor

What is the correct way to use a rich text editor in a label template?

I’ve tried the normal way like {=myRteProperty} but that just returns [object Object]

I also tried with an expression like ${myRte.markup}. That returned the html also, eg. <p>Hello</p>. I then changed to ${myRte.markup | strip-html}, but then it returned nothing.

Your last example is getting close!

UFM:

{=myRte | stripHtml}

Without the .markup, because that is handled by stripHtml.

Also works with UFMJS:

${myRte | stripHtml}

Also note how I’m using “stripHtml” over “strip-html”, because the Heximal Expressions library underneath does not like those dashes.

1 Like

Cool, thanks!

Should we update the documentation at Umbraco Flavored Markdown | Umbraco CMS then?

I keep forgetting that the camel-case filters are part of 16.4 which is not out yet. It releases tomorrow, then we can update the documentation. Before then you have to use the dashes (strip-html) which only works with UFM, not UFMJS.

No worries, I’m using 16.4-rc already :slight_smile:

1 Like