Opened 17 years ago

Closed 16 years ago

#339 closed Bug (fixed)

Speller Pages breaks html code when incorrect word is present in html tag

Reported by: chris Owned by:
Priority: Normal Milestone: FCKeditor 2.6
Component: Server : ColdFusion Version:
Keywords: Confirmed Cc:

Description

When running spell checker in fck editor (cf implementation) if an incorrectly spelt word also appears in an html tag the spell checker attempts to insert it's code breaking the original html. This occurs in any supported browser/os.

We have overcome this issue and thought you might be interested in our solution to this.

E.g. <img src="whatever.jpg" alt="splling"> <p>Some text with splling error</p>

The spell checker returns "splling" as incorrectly spelt but when running the function writeBody in wordWindow.js it finds splling in the alt tag and alters this part of the html causing it to break.

We have resolved this by replacing the line begin_idx = wordtxt.indexOf( orig[i], end_idx ); in wordWindow.js on approximately ln 170 with var rExp = new RegExp ( orig[i] + '(?![<]*?>)' ); var searchStr = wordtxt.substr ( end_idx ); begin_idx = searchStr.search ( rExp ) + end_idx;

Change History (10)

comment:1 Changed 17 years ago by nobkins

I can confirm that this is an issue as I am having the same problem. I thought it was the alt tag that broke the spell checker and had not diagnosed that it is spelling errors in the alt tag that breaks it. I have replicated the fault but cannot check if the fix suggested works at the moment.

comment:2 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: speller pages removed
Priority: LowNormal

#426 has been marked as DUP of this one.

comment:3 Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added

Part of the problem can be resolved by adding the "rem-sgml-check" option to the Aspell call:

<cfset aspell_opts = "-a --lang=#lang# --encoding=utf-8 -H --rem-sgml-check=alt">

It seams that, by default, Aspell checks "alt" attributes. Here is a reference for all available options.

Now, with that new attribute, Aspell will ignore all tags. The problem will still be there, because SpellerPages will continue to make changes inside tags, but now it will do that only if a misspelled word found in the text is also found inside a tag (like "splling" in the provided sample). At least we can reduce the problem occurrence with this small change.

A definitive solution is still to come, but I believe that the best think will be doing is to get rid of SpellerPages and implement a spell checker ourselves.

comment:4 Changed 17 years ago by Frederico Caldeira Knabben

[270] has added the "rem-sgml-check" to Aspell calls.

comment:5 Changed 17 years ago by Ajos1

I am suffering from this problem as well... I have tried the rem-sgml-check thing... with or without it... I still suffer from this strange problem...

Basically... mis-spellings and suggestions... it is all okay... until the <img alt= > ... then at this point it shows the wrong solutions for each mis-spelling from that point... It shows the error "Neef" and for this mis-spelling... it shows the solutions for the PREVIOUS mis-spelling "de"...

(I tried it from a text file through Aspell... and that shows the mis-spellings and correct suggestions... so I think Fckeditor is messing up...)


<p><strong>It's probably unnecessary to say that Extrema Outdoor's reputation as the small and warm house festival with great music and even better atmosphere is known throughout the country and across its borders. Under this year's 'Strange World' theme, Extrema provided a variety of musical flavors, ranging from MTV's Electro-Eastern Island or Supernatural's Gardens of Babylon Bossanova to five other wonders of the world. Designed &amp; built by anonymous architects and craftsmen, but on this day tended by the likes of Roger Sanchez, Victor Calderone, James Holden, Danny Howells and the Audiobullys.</strong></p> <p><img alt="Extrema Outdoor Festival 2004 with Sander Kleinenberg, Matthew Dekzay, Danny Howells" border="0" src="/images/eventreviews/partyreviews2004/2004_07_17_extrema/mid/00001.jpg" /></p> <p>A walk across the terrain brought us from Belgium's Tom de Neef, assisted by a vocalist and fantastic fiddler to Bart van Wissen's progressive sounds which were perfect for the early afternoon. As Extrema had to suffer from a few cancellations, Luke Chable would be replaced by The Scumfrog. But to stir things up once more, it seemed that the New York-based Dutchman was to on his part replaced by a young Scandinavian: Nils Noa. Pumping tracks with nice breaks were his weapons of choice in this Taj Mahal-esque setting. Extrema did an excellent job in realising a nice decoration for every area, although not all came across. For example: how do you try to reflect the Eastern Island-feeling without those bloody statues? 'Less decoration, more music' must the MTV/Electro crew have thought, as Swedish Petter was spinning his records. But to my disappointment, his mixing was quite sloppy.</p>

comment:6 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.6

comment:7 Changed 16 years ago by Frederico Caldeira Knabben

#681 has been marked as DUP.

comment:8 Changed 16 years ago by Frederico Caldeira Knabben

Correction: #681 is not a DUP of this one.

comment:9 Changed 16 years ago by Frederico Caldeira Knabben

#710 has been marked as DUP.

comment:10 Changed 16 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

Fixed with [1189].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy