Forum

Thread tagged as: Ace

ace editor and html

I am using the ace editor for my blog posts as it is possible this way to add some classes (i need them to apply styles, for example a span element on the first letter of a paragraph).

In the post.html file i wrote :

<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="ace" size="xxl autowidth" required="true" />

I thought it would output some HTML because of this in the config.inc file (/perch/addons/plugins/editors/ace/_config.inc) :

if (textarea.hasClass('textile')) {
                editor.getSession().setMode("ace/mode/textile");
            }else if (textarea.hasClass('markdown')) {
                editor.getSession().setMode("ace/mode/markdown");
            }else{
                editor.getSession().setMode("ace/mode/html");
            }

But it doesn't work, it outputs the tags with the text...

Anyone has an idea ? By the way anyone has an idea of how to apply classes in the body of a text ? For example :

<p class="first-paragraph"><span class="first-letter">C</span>ivilization and sea power arose.</p>
DEVAUX Nicolas

DEVAUX Nicolas 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Add html="true" to your template tag. Perch templates automatically escape content, so if the content is HTML, you need to let Perch know.

Thanks !