sleemanj / xinha

WYSIWYG HTML Editor Component (turns <textarea> into HTML editors)
http://trac.xinha.org/
Other
13 stars 2 forks source link

HTML code button for xinha editing can't be used more than once (Trac #1731) #1731

Open sleemanj opened 4 years ago

sleemanj commented 4 years ago

I installed xinha and am testing it at https://www.sphincterpolice.com/populum/test_xinha.php

(Yeah, I know, that domain wasn't chosen by me...)

When I type in text and then use the <> button to look at the code, it works - once. After that, when pressed, it simply inserts weird characters into the text.

....Burton Smith vidya@webwisesage.com

Reported by guest, migrated from http://trac.xinha.org/ticket/1731

sleemanj commented 4 years ago

@sleemanj changed cc to **vidya**~~@webwisesage.com~~

sleemanj commented 4 years ago

@sleemanj commented:

Hmm, interesting.

First thing, your xinha_plugins should be

  xinha_plugins:  
  [ 
    'common'
    //{ from: 'xinha-1.5.4/plugins', load: ['InsertVisual'] }
  ],

not sure where you got 'default' and 'commonsearch' from, those are not correct.

But that doesn't make a difference to the problem at hand.

For some reason I can't trigger the problem in the Xinha examples, or in my own use of Xinha, but I certainly can in yours. Very strange.

I think probably I have to rewrite the Undo Queue handling slightly to make it a proper stack, it's all a bit odd.

A quick fix for you though would probably be (not tested) to change line 5316 of XinhaCore.js from

    take = (this._undoQueue[this._undoPos - 1].txt != snapshotData.txt);

to

    try { take = (this._undoQueue[this._undoPos - 1].txt != snapshotData.txt); } catch(e) { take = true; }

then clear your cache and reload.