I've got an implementation of CK Editor that uses the SCAYT / GRAYT plugin, and I've found what I think might be a bug in CK Editor itself.
I'm using version 4.5.11
Consider this HTML:
<tr>
<td align="left" bgcolor="#e6e1ce" height="30" id="table_column1" valign="middle"><span style="font-family: verdana,geneva,sans-serif,arial;">Content</span></td>
<td align="left" bgcolor="#f8f9f3" height="30" id="table_column2" valign="middle"><span style="font-family: verdana,geneva,sans-serif,arial; ">Content</span></td>
<td align="left" bgcolor="#e6e1ce" height="30" id="table_column1_2" valign="middle"><span style="font-family: verdana,geneva,sans-serif,arial;">Content</span></td>
</tr>
When my editor loads and the HTML content is rendered, the SCAYT and GRAYT plugins start doing their magic and checking the contents for spelling and grammar issues.
The problem is with GRAYT. It mistakes the text of two of the <td> elements as one sentence or phrase, and attempts to place a <span> around them that's supposed to simply tell the user to correct their grammar.
Instead, it produces this result:
<tr>
<span class="gramm-problem" data-grayt-phrase="Content Content">
<td align="left" bgcolor="#e6e1ce" height="30" id="table_column1" valign="middle">
<span style="font-family: verdana,geneva,sans-serif,arial;">Content</span>
</td>
<td align="left" bgcolor="#f8f9f3" height="30" id="table_column2" valign="middle">
<span style="font-family: verdana,geneva,sans-serif,arial; ">Content</span>
</td>
</span>
<td align="left" bgcolor="#e6e1ce" height="30" id="table_column1_2" valign="middle">
<span style="font-family: verdana,geneva,sans-serif,arial;">Content</span>
</td>
</tr>
Obviously, this is invalid HTML, and is undesired. The real problem is that it breaks the layout of the table in the editor.
Does anybody know what I can do to fix this? Checking the CK Editor / Web Spell Checker documentation yielded almost no information on how to control this functionality. At best, I can disable it, which I believe is also undesired.
The issue that you described is known issue and we plan to work on it in a few weeks. Now GrammarAsYouType (GRAYT) is only available as a plug-in for CKEditor 4+ and it is the Alpha version. Currently, our team is working on its improvement.
As a workaround, at this moment we can suggest turning off the GRAYT functionality on the SCAYT startup:
As an alternative, you can turn off grammar check in the table (td, tr). But note that it will affect both SCAYT and GRAYT (no spelling check in
<tr>or<td>tags).More details about all SCAYT parameters for CKEditor 4+ that can be changed, you can find on our website:http://wiki.webspellchecker.net/doku.php?id=scayt_parameters_ckeditor4