georgephillips
georgephillips

Reputation: 3570

How to remove Aloha Editor from DOM?

I am using Aloha to edit contents on a client's website and want to remove all extra DOM elements and attributes when I save.

A paragraph tag goes from:

<p></p>

to:

<p id="79a2eed4-1d7d-55a9-1c44-d384d35edf4f" 
    class="aloha-editable aloha-editable-active" 
    contenteditable="true" style=""></p>

I want to remove all of those added elements. Is there a destroy call in the Aloha API that I have missed?

Upvotes: 1

Views: 770

Answers (1)

Inshallah
Inshallah

Reputation: 4814

The following reverts an editable to its non-editable form

$('#editable').mahalo();

This should also remove the attributes added by aloha (classes, contenteditable=true, etc.).

I have added it to the official documentation.

Upvotes: 2

Related Questions