When I edit an article that contains media, tinyMCE thinks its dirty immediately. This appears to be due to the isDirty function checking the startContent property against the getContent method. When I compare those two manually, I can see the issue:

startContent:

<p>[[{"type":"media","view_mode":"media_preview","fid":"29660","attributes":{"alt":"", ...

getContent({format:'raw', no_events:1}):

<p><img class="media-image img__fid__29660 img__view_mode__media_preview" src="http://www.c ...

As you can see, one is in a pre-rendered state and so they don't match when comparing via isDirty.

Does anyone know a workaround for this?

Thanks,
Dave

Comments

TwoD’s picture

Hmm, I don't know at this point. Why is the "dirty" state important for you? Does it trigger autosaves or something like that? Just want to know a bit of the background.

TwoD’s picture

Issue summary: View changes

unmunging code