Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

As of release 5.4.0.x preceding products based on the SpellCheckAsYouType (SCAYT) core as well as WProofreader use the special markup mechanism for underling spelling and grammar errors. This markup mechanism adds <span> elements with special classes, e.g. class="wsc-spelling-problem", which without preliminary cleaning might got to database and then prepopulated to the text.

We understand that this might be a huge problem to our customers and their end users. Thus, we are developing a new mechanism of highlighting spelling and grammar problems which will resolve the issue with extra <spans>.

Until then, if you have such a problem, we recommend you to implement a mechanism that on your end that will clean extra <spans> before saving the information to a database. Below you can find an example that uses the removeMarkupFromString command. 

Code Block
<script>

Right now this is expected behavior when WProofreader creates extra spans in CKEditor 4 for its markup, and we can't fix this based on the current product mechanics. On July 2019 we plan to implement a new approach of the WPoofreader work, which should resolve such type of cases. We plan to add our markup on a separate layer separate from CKEditor. However, deadlines can be shifted due to tasks with higher priorities. 

As for now, you can add some extra code on your side to clean spans. For example, you can use a "removeMarkupFromString" command. 

Code Block
var wscInstance; // You will be able to call WPRoofreaderWProofreader API using this variable

window.WEBSPELLCHECKER_CONFIG = {
    ...
    onLoad: function(instance) {
        wscInstance = instance; // Here you make WProofreader instance available from your code
    }
}
</script>

After that you can use it as follows to clean unnecessary spans that have been added by WProofreaderSo you can do this:

Code Block
wscInstance.removeMarkupFromString('<p>Example <span class="wsc-spelling-problem" data-spelling-word="texxt" data-wsc-lang="en_US">texxt</span>.</p>'); // It will return'<p>Example texxt.</p>'

Here you can find more information about available Web API commands and how they work. Please note that such implementation should be done on our side and our team can't provide you the specific instructions on how to do itFor more options and methods in WProofreader, please visit the API options and methods documentation.