sourish-rygbee / jquery-spellchecker

Automatically exported from code.google.com/p/jquery-spellchecker
0 stars 0 forks source link

Misspelled words are deleted from the text after hitting "remove spelling" #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open the spellchecker demo page http://spellchecker.jquery.badsyntax.co.uk/
2. Hit "Check Spelling"
3. Hit "Remove Spelling"

What is the expected output? What do you see instead?

Instead of showing the misspelled words without underlines and suggestion 
popups, they are simply deleted from the text. If you hit "check spelling" 
another time, an alert says that no mistakes have been found.

Original issue reported on code.google.com by fbuchin...@gmail.com on 10 Feb 2011 at 10:35

GoogleCodeExporter commented 9 years ago
I have just come across this issue as well. Looks like "remove" gets rid of the 
spans that have been put round the identified words along with the words.

Original comment by tcsmith1...@googlemail.com on 26 Mar 2012 at 10:40

GoogleCodeExporter commented 9 years ago
Had a look at this a bit more and managed to come up with a fix. Replace line 
316 from

this.after(this.innerHTML).remove();

to

$(this).replaceWith(this[0].innerText);

and it seems to fix the issue. Can I help to submit this at all?

Original comment by tcsmith1...@googlemail.com on 26 Mar 2012 at 10:57

GoogleCodeExporter commented 9 years ago
Changing to

$(this).replaceWith($(this).html());

Seems to work.

Original comment by jason.fa...@gmail.com on 29 Aug 2012 at 11:46