Ticket #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;