Ticket #2326 (new Bug)

Opened 5 months ago

Last modified 4 months ago

Using SpellerPages/aspell causing odd behavior

Reported by: auralvance Owned by:
Priority: Normal Milestone:
Component: UI : Spell Checker Version: FCKeditor 2.6.2
Keywords: HasPatch Cc:

Description

I first reported this over at the Drupal module's issue page since that's where I first noticed it, but according to the author, it is directly a FCKeditor bug. I'll cut and paste what I already pasted there:

Since I started running my own Drupal site, and using FCKeditor as my in place WYSIWYG editor, I've noticed that there are times when using the integrated spell checker results in it always being one word off, making it completely useless. It doesn't always happen, but in about 50% of my posts I end up with a spell checker that is always one word off from the word it's viewing, so you never can tell what you're changing. See the attached images from my actual use case if you don't know what I mean. It also seems to have this issue specifically around links in the page, as you can see from the pictures, and actually displays the code. Once it breaks like this it is stuck that way. Opening the page again results in the same behaviour being reproduced. My guess is that it's choking on some code in the post... but since it's code generated by FCKeditor, it's an internal issue.

I'm using Firefox 3, FCKeditor 2.6.2, the latest Drupal module for 6.2, and a backend of Speller Pages (aspell) on a Linux box. My guess is that it is a FCKeditor problem, but might as well start here.

Attachments

Screenshot1.png (128.0 KB) - added by auralvance 5 months ago.
screenshot
Screenshot2_3.png (126.7 KB) - added by auralvance 5 months ago.
screenshot
Screensho3.png (127.2 KB) - added by auralvance 5 months ago.
screenshot
writebody.zip (4.6 KB) - added by MarkWB 4 months ago.

Change History

Changed 5 months ago by auralvance

screenshot

Changed 5 months ago by auralvance

screenshot

Changed 5 months ago by auralvance

screenshot

Changed 4 months ago by MarkWB

Changed 4 months ago by MarkWB

  • milestone set to FCKeditor 2.6.4

Problems here are caused by the client side searching for misspelled words in places the server discards for spell checking. Misspelled words the server returns will never be located within a tag.

Attached are two versions of only the writeBody() function of 'wordWindow.js'. Either version should fix the problems of this ticket.

'writebody0.js' is hack on original script that'll fix wrong rendering and wrong word sequence alignment as illustrated here. It does this by skipping over tags as it looks for misspelled words. This additionally discards words it can't find, which will fix most unfound word cases, but not truly handle ALL possible cases if any words can't be found. I'm unaware of any case when this won't find words returned by Aspell; but if it doesn't, the original script in all (unknown to me) cases will certainly do as line 164 says it will:

	// word not found? messed up!

'writebody1.js' is a redesign of logic that 'should' always for all cases be able to handle unfound words by omitting only those words, and also only looks between tags for words. I needed this for my own server side implementation that uses pspell of php for which unfound words (those containing html markup) are certainly a possibility.

(Note that both versions here also include the suggestion of ticket #2470)

I hope this helps.

Changed 4 months ago by auralvance

I can verify that option #2 works great after testing it on my site where I reported the original problem. I figure that #1 works as well, but a fix is a fix! Thank you very much for the patch. I'll be glad to see this make its way into 2.6.4.

Can someone decided which choice is more appropriate and upstream this please? Thanks.

Changed 4 months ago by alfonsoml

  • keywords HasPatch added
  • milestone FCKeditor 2.6.4 deleted
Note: See TracTickets for help on using tickets.